[vlc-commits] aout: balance stereo-mode variable create and destroy calls
Rémi Denis-Courmont
git at videolan.org
Sat May 23 18:29:49 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat May 23 18:53:26 2015 +0300| [3e48ceade6964e09f8b1777585df4037f9ee454b] | committer: Rémi Denis-Courmont
aout: balance stereo-mode variable create and destroy calls
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3e48ceade6964e09f8b1777585df4037f9ee454b
---
src/audio_output/dec.c | 9 +++++++--
src/audio_output/output.c | 10 ----------
2 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 5e5eb99..cafaba6 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -65,13 +65,17 @@ int aout_DecNew( audio_output_t *p_aout,
return -1;
}
+ var_Create (p_aout, "stereo-mode",
+ VLC_VAR_INTEGER | VLC_VAR_HASCHOICE | VLC_VAR_DOINHERIT);
+ vlc_value_t txt;
+ txt.psz_string = _("Stereo audio mode");
+ var_Change (p_aout, "stereo-mode", VLC_VAR_SETTEXT, &txt, NULL);
+
aout_owner_t *owner = aout_owner(p_aout);
/* TODO: reduce lock scope depending on decoder's real need */
aout_OutputLock (p_aout);
- var_Destroy( p_aout, "stereo-mode" );
-
/* Create the audio output stream */
owner->volume = aout_volume_New (p_aout, p_replay_gain);
@@ -93,6 +97,7 @@ int aout_DecNew( audio_output_t *p_aout,
error:
aout_volume_Delete (owner->volume);
aout_OutputUnlock (p_aout);
+ var_Destroy (p_aout, "stereo-mode");
return -1;
}
diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index 33acff0..9856ac7 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -376,16 +376,6 @@ int aout_OutputNew (audio_output_t *aout, audio_sample_format_t *restrict fmt)
return -1;
}
- if (!var_Type (aout, "stereo-mode"))
- {
- var_Create (aout, "stereo-mode",
- VLC_VAR_INTEGER | VLC_VAR_HASCHOICE | VLC_VAR_DOINHERIT);
-
- vlc_value_t txt;
- txt.psz_string = _("Stereo audio mode");
- var_Change (aout, "stereo-mode", VLC_VAR_SETTEXT, &txt, NULL);
- }
-
/* The user may have selected a different channels configuration. */
var_AddCallback (aout, "stereo-mode", aout_ChannelsRestart, NULL);
switch (var_GetInteger (aout, "stereo-mode"))
More information about the vlc-commits
mailing list