Commit 3e48cead authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

aout: balance stereo-mode variable create and destroy calls

parent ddc97a84
......@@ -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;
}
......
......@@ -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"))
......
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