From 724f60bf9a27c823254dcc94adf569c9a35f5890 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 22 Aug 2016 12:12:10 +0200 Subject: audio: do not apply --audio-channels if spdif passthrough is in use If spdif is enabled, the channel layout has no meaning other than setting the number of channels. The number of channels must be fixed to achieve the exact bitrate required. Fixes #3445. --- player/audio.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'player') diff --git a/player/audio.c b/player/audio.c index a98fa7784d..85c7a75c29 100644 --- a/player/audio.c +++ b/player/audio.c @@ -379,14 +379,18 @@ static void reinit_audio_filters_and_output(struct MPContext *mpctx) if (opts->ao_null_fallback && !spdif_fallback) ao_flags |= AO_INIT_NULL_FALLBACK; - if (!opts->audio_output_channels.set || opts->audio_output_channels.auto_safe) - ao_flags |= AO_INIT_SAFE_MULTICHANNEL_ONLY; - if (opts->audio_stream_silence) ao_flags |= AO_INIT_STREAM_SILENCE; - mp_chmap_sel_list(&afs->output.channels, opts->audio_output_channels.chmaps, - opts->audio_output_channels.num_chmaps); + if (af_fmt_is_pcm(afs->output.format)) { + if (!opts->audio_output_channels.set || + opts->audio_output_channels.auto_safe) + ao_flags |= AO_INIT_SAFE_MULTICHANNEL_ONLY; + + mp_chmap_sel_list(&afs->output.channels, + opts->audio_output_channels.chmaps, + opts->audio_output_channels.num_chmaps); + } mp_audio_set_channels(&afs->output, &afs->output.channels); -- cgit v1.2.3