[vlc-commits] Revert "mmdevice: add a way to enable/disable passthrough"
Thomas Guillem
git at videolan.org
Thu Mar 29 18:34:58 CEST 2018
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Mar 29 17:00:30 2018 +0200| [4b5b85f797c3cce2f96f060799b1348c19d6c85e] | committer: Thomas Guillem
Revert "mmdevice: add a way to enable/disable passthrough"
This reverts commit 872c6011e8e0c978cacf7494e5972ab4b963a6f0.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4b5b85f797c3cce2f96f060799b1348c19d6c85e
---
modules/audio_output/mmdevice.c | 38 ++++++++------------------------------
1 file changed, 8 insertions(+), 30 deletions(-)
diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index 5e41c5b6ee..c2f190f01f 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -1122,20 +1122,18 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
const bool b_hdmi = AOUT_FMT_HDMI(fmt);
if (b_spdif || b_hdmi)
{
- if (!var_GetBool(aout, "mmdevice-digital-output"))
- return -1;
-
- if (b_hdmi || fmt->i_format == VLC_CODEC_DTS)
+ switch (var_InheritInteger(aout, "mmdevice-passthrough"))
{
- const bool no_codec_hd =
- var_InheritInteger(aout, "mmdevice-passthrough") == MM_PASSTHROUGH_ENABLED;
- if (no_codec_hd)
- {
+ case MM_PASSTHROUGH_DISABLED:
+ return -1;
+ case MM_PASSTHROUGH_ENABLED:
if (b_hdmi)
return -1;
- else
+ else if (fmt->i_format == VLC_CODEC_DTS)
var_SetBool(aout, "dtshd", false );
- }
+ /* falltrough */
+ case MM_PASSTHROUGH_ENABLED_HD:
+ break;
}
}
@@ -1239,16 +1237,6 @@ static void Stop(audio_output_t *aout)
sys->stream = NULL;
}
-static int DigitalOutCallback(vlc_object_t *obj, const char *varname,
- vlc_value_t oldval, vlc_value_t newval, void *data)
-{
- (void) varname; (void) oldval; (void) newval; (void) data;
- audio_output_t *aout = (audio_output_t *)obj;
-
- aout_RestartRequest(aout, AOUT_RESTART_OUTPUT);
- return 0;
-}
-
static int Open(vlc_object_t *obj)
{
audio_output_t *aout = (audio_output_t *)obj;
@@ -1326,14 +1314,6 @@ static int Open(vlc_object_t *obj)
LeaveCriticalSection(&sys->lock);
LeaveMTA(); /* Leave MTA after thread has entered MTA */
- int passthrough = var_InheritInteger(aout, "mmdevice-passthrough");
-
- /* Inherit mmdevice-digital-output bool from mmdevice-passthrough */
- var_Create(aout, "mmdevice-digital-output", VLC_VAR_BOOL);
- var_SetBool(aout, "mmdevice-digital-output",
- passthrough != MM_PASSTHROUGH_DISABLED);
- var_AddCallback (aout, "mmdevice-digital-output", DigitalOutCallback, NULL);
-
aout->start = Start;
aout->stop = Stop;
aout->time_get = TimeGet;
@@ -1357,8 +1337,6 @@ static void Close(vlc_object_t *obj)
audio_output_t *aout = (audio_output_t *)obj;
aout_sys_t *sys = aout->sys;
- var_DelCallback (aout, "mmdevice-digital-output", DigitalOutCallback, NULL);
-
EnterCriticalSection(&sys->lock);
sys->requested_device = default_device; /* break out of MMSession() loop */
sys->it = NULL; /* break out of MMThread() loop */
More information about the vlc-commits
mailing list