Commit 73361286 authored by Thomas Guillem's avatar 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
parent 796689c4
......@@ -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);
......@@ -1452,7 +1452,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);
......@@ -1527,7 +1540,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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment