[vlc-commits] auhal: do passthrough only when requested
Thomas Guillem
git at videolan.org
Fri Mar 9 11:24:52 CET 2018
vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Mar 9 10:24:21 2018 +0100| [d2a5dd9587d4e9b8c63e3d4413805f3f7c637073] | committer: Thomas Guillem
auhal: do passthrough only when requested
This module should do passthrough only when requested by the user (by choosing
the (Encoded Output) audio device).
This fixes a regression since 2.2.x
(cherry picked from commit 733612862b0b4ce624b9398a4f2ffc3281df9b75)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=d2a5dd9587d4e9b8c63e3d4413805f3f7c637073
---
modules/audio_output/auhal.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index 8ea6036820..54a34fdda1 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -886,7 +886,7 @@ SwitchAudioDevice(audio_output_t *p_aout, const char *name)
else
p_sys->i_new_selected_dev = 0;
- p_sys->i_new_selected_dev = p_sys->i_new_selected_dev & ~AOUT_VAR_SPDIF_FLAG;
+ p_sys->i_new_selected_dev = p_sys->i_new_selected_dev;
aout_DeviceReport(p_aout, name);
aout_RestartRequest(p_aout, AOUT_RESTART_OUTPUT);
@@ -1453,7 +1453,20 @@ Start(audio_output_t *p_aout, audio_sample_format_t *restrict fmt)
p_sys->b_changed_mixing = false;
vlc_mutex_lock(&p_sys->selected_device_lock);
- p_sys->i_selected_dev = p_sys->i_new_selected_dev;
+ bool do_spdif;
+ if (AOUT_FMT_SPDIF (fmt))
+ {
+ if (!(p_sys->i_new_selected_dev & AOUT_VAR_SPDIF_FLAG))
+ {
+ vlc_mutex_unlock(&p_sys->selected_device_lock);
+ return VLC_EGENERIC;
+ }
+ do_spdif = true;
+ }
+ else
+ do_spdif = false;
+
+ p_sys->i_selected_dev = p_sys->i_new_selected_dev & ~AOUT_VAR_SPDIF_FLAG;
aout_FormatPrint(p_aout, "VLC is looking for:", fmt);
@@ -1528,7 +1541,7 @@ Start(audio_output_t *p_aout, audio_sample_format_t *restrict fmt)
mtime_t i_latency_us = i_latency_samples * CLOCK_FREQ / fmt->i_rate;
/* Check for Digital mode or Analog output mode */
- if (AOUT_FMT_SPDIF (fmt))
+ if (do_spdif)
{
if (StartSPDIF (p_aout, fmt, i_latency_us) == VLC_SUCCESS)
{
More information about the vlc-commits
mailing list