summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-08-22 12:12:10 +0200
committerwm4 <wm4@nowhere>2016-08-22 12:12:10 +0200
commit724f60bf9a27c823254dcc94adf569c9a35f5890 (patch)
treefba2f7ae93c8fe00920e1d668d77cff3cc30815d /player
parent74d4073771cf9421b400189d240532663e98f239 (diff)
downloadmpv-724f60bf9a27c823254dcc94adf569c9a35f5890.tar.bz2
mpv-724f60bf9a27c823254dcc94adf569c9a35f5890.tar.xz
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.
Diffstat (limited to 'player')
-rw-r--r--player/audio.c14
1 files changed, 9 insertions, 5 deletions
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);