From d967649e84f40c2919944ad8accc43891507d04f Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 22 Jul 2013 15:12:39 +0200 Subject: mplayer: cosmetics: move function Also get rid of the useless comment. --- core/mplayer.c | 57 +++++++++++++++++++++++++-------------------------------- 1 file 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; -- cgit v1.2.3