[vlc-commits] aout: keep initial "stereo-mode" value set by options
Thomas Guillem
git at videolan.org
Tue Aug 29 11:47:49 CEST 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Aug 29 11:47:12 2017 +0200| [c4b028447a921c8ce7a796305955a8abd2ce0a73] | committer: Thomas Guillem
aout: keep initial "stereo-mode" value set by options
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c4b028447a921c8ce7a796305955a8abd2ce0a73
---
src/audio_output/aout_internal.h | 2 ++
src/audio_output/dec.c | 2 +-
src/audio_output/output.c | 2 ++
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index 2852b6f3d8..77070e093b 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -83,6 +83,8 @@ typedef struct
bool discontinuity;
} sync;
+ int initial_stereo_mode; /**< Initial stereo mode set by options */
+
audio_sample_format_t input_format;
audio_sample_format_t mixer_format;
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 11aa7b6ce0..f37a6e396b 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -83,7 +83,7 @@ int aout_DecNew( audio_output_t *p_aout,
owner->request_vout = *p_request_vout;
var_Change (p_aout, "stereo-mode", VLC_VAR_SETVALUE,
- &(vlc_value_t) { .i_int = AOUT_VAR_CHAN_UNSET }, NULL);
+ &(vlc_value_t) { .i_int = owner->initial_stereo_mode }, NULL);
owner->filters_cfg = AOUT_FILTERS_CFG_INIT;
if (aout_OutputNew (p_aout, &owner->mixer_format, &owner->filters_cfg))
diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index 1bd916044e..2fa2b976ae 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -336,6 +336,8 @@ audio_output_t *aout_New (vlc_object_t *parent)
/* Stereo mode */
var_Create (aout, "stereo-mode", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
+ owner->initial_stereo_mode = var_GetInteger (aout, "stereo-mode");
+
var_AddCallback (aout, "stereo-mode", StereoModeCallback, NULL);
vlc_value_t txt;
txt.psz_string = _("Stereo audio mode");
More information about the vlc-commits
mailing list