summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-22 15:12:39 +0200
committerwm4 <wm4@nowhere>2013-07-22 15:13:04 +0200
commitd967649e84f40c2919944ad8accc43891507d04f (patch)
tree0e7aea4820482354956934037a4cbbf0c605a315
parenta48f7a546c8044decfd68409663530d6e9d06a14 (diff)
downloadmpv-d967649e84f40c2919944ad8accc43891507d04f.tar.bz2
mpv-d967649e84f40c2919944ad8accc43891507d04f.tar.xz
mplayer: cosmetics: move function
Also get rid of the useless comment.
-rw-r--r--core/mplayer.c57
1 files changed, 25 insertions, 32 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index a4b68f7402..a71beb54b0 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -1173,38 +1173,6 @@ static void print_status(struct MPContext *mpctx)
talloc_free(line);
}
-/**
- * \brief build a chain of audio filters that converts the input format
- * to the ao's format, taking into account the current playback_speed.
- * sh_audio describes the requested input format of the chain.
- * ao describes the requested output format of the chain.
- */
-static int build_afilter_chain(struct MPContext *mpctx)
-{
- struct sh_audio *sh_audio = mpctx->sh_audio;
- struct ao *ao = mpctx->ao;
- struct MPOpts *opts = &mpctx->opts;
- int new_srate;
- if (af_control_any_rev(sh_audio->afilter,
- AF_CONTROL_PLAYBACK_SPEED | AF_CONTROL_SET,
- &opts->playback_speed))
- new_srate = sh_audio->samplerate;
- else {
- new_srate = sh_audio->samplerate * opts->playback_speed;
- if (new_srate != ao->samplerate) {
- // limits are taken from libaf/af_resample.c
- if (new_srate < 8000)
- new_srate = 8000;
- if (new_srate > 192000)
- new_srate = 192000;
- opts->playback_speed = (float)new_srate / sh_audio->samplerate;
- }
- }
- return init_audio_filters(sh_audio, new_srate,
- &ao->samplerate, &ao->channels, &ao->format);
-}
-
-
typedef struct mp_osd_msg mp_osd_msg_t;
struct mp_osd_msg {
/// Previous message on the stack.
@@ -1565,6 +1533,31 @@ static void update_osd_msg(struct MPContext *mpctx)
}
}
+static int build_afilter_chain(struct MPContext *mpctx)
+{
+ struct sh_audio *sh_audio = mpctx->sh_audio;
+ struct ao *ao = mpctx->ao;
+ struct MPOpts *opts = &mpctx->opts;
+ int new_srate;
+ if (af_control_any_rev(sh_audio->afilter,
+ AF_CONTROL_PLAYBACK_SPEED | AF_CONTROL_SET,
+ &opts->playback_speed))
+ new_srate = sh_audio->samplerate;
+ else {
+ new_srate = sh_audio->samplerate * opts->playback_speed;
+ if (new_srate != ao->samplerate) {
+ // limits are taken from libaf/af_resample.c
+ if (new_srate < 8000)
+ new_srate = 8000;
+ if (new_srate > 192000)
+ new_srate = 192000;
+ opts->playback_speed = (float)new_srate / sh_audio->samplerate;
+ }
+ }
+ return init_audio_filters(sh_audio, new_srate,
+ &ao->samplerate, &ao->channels, &ao->format);
+}
+
static int recreate_audio_filters(struct MPContext *mpctx)
{
struct MPOpts *opts = &mpctx->opts;