<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div><br></div>
<div>On Fri, Jul 14, 2017, at 02:57, Rémi Denis-Courmont wrote:<br></div>
<blockquote type="cite"><div defang_data-gmailquote="yes"><div>Le 13 juillet 2017 23:19:01 GMT+08:00, Thomas Guillem <git@videolan.org> a écrit :<br></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0pt;margin-right:0pt;margin-bottom:0pt;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;"><pre><div>vlc | branch: master | Thomas Guillem <thomas@gllm.fr> | Tue Jul 11 13:05:20 2017 +0200| [9c6117e88eab4bb2c44f3294c622c17d194164ec] | committer: Thomas Guillem<br></div>
<div><br></div>
<div>aout: increase stereo-mode lifecycle<br></div>
<div><br></div>
<div>It's not reset anymore when the aout is restarted<br></div>
<div><br></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(114, 159, 207);padding-left:1ex;"> <a href="http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9c6117e88eab4bb2c44f3294c622c17d194164ec">http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9c6117e88eab4bb2c44f3294c622c17d194164ec</a><br></blockquote><div>---<br></div>
<div><br></div>
<div> src/audio_output/dec.c | 7 -----<br></div>
<div> src/audio_output/output.c | 73 ++++++++++++++++++++++++++---------------------<br></div>
<div> 2 files changed, 41 insertions(+), 39 deletions(-)<br></div>
<div><br></div>
<div>diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c<br></div>
<div>index bceb817faf..d50a656d35 100644<br></div>
<div>--- a/src/audio_output/dec.c<br></div>
<div>+++ b/src/audio_output/dec.c<br></div>
<div>@@ -69,11 +69,6 @@ int aout_DecNew( audio_output_t *p_aout,<br></div>
<div> return -1;<br></div>
<div> }<br></div>
<div> <br></div>
<div>- var_Create (p_aout, "stereo-mode", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);<br></div>
<div>- vlc_value_t txt;<br></div>
<div>- txt.psz_string = _("Stereo audio mode");<br></div>
<div>- var_Change (p_aout, "stereo-mode", VLC_VAR_SETTEXT, &txt, NULL);<br></div>
<div>-<br></div>
<div> aout_owner_t *owner = aout_owner(p_aout);<br></div>
<div> <br></div>
<div> /* TODO: reduce lock scope depending on decoder's real need */<br></div>
<div>@@ -108,7 +103,6 @@ error:<br></div>
<div> aout_volume_Delete (owner->volume);<br></div>
<div> owner->volume = NULL;<br></div>
<div> aout_OutputUnlock (p_aout);<br></div>
<div>- var_Destroy (p_aout, "stereo-mode");<br></div>
<div> return -1;<br></div>
<div> }<br></div>
<div> <br></div>
<div>@@ -138,7 +132,6 @@ void aout_DecDelete (audio_output_t *aout)<br></div>
<div> aout_volume_Delete (owner->volume);<br></div>
<div> owner->volume = NULL;<br></div>
<div> aout_OutputUnlock (aout);<br></div>
<div>- var_Destroy (aout, "stereo-mode");<br></div>
<div> }<br></div>
<div> <br></div>
<div> static int aout_CheckReady (audio_output_t *aout)<br></div>
<div>diff --git a/src/audio_output/output.c b/src/audio_output/output.c<br></div>
<div>index d9ac95a78a..1092e58e0b 100644<br></div>
<div>--- a/src/audio_output/output.c<br></div>
<div>+++ b/src/audio_output/output.c<br></div>
<div>@@ -320,6 +320,13 @@ audio_output_t *aout_New (vlc_object_t *parent)<br></div>
<div> &val, &text);<br></div>
<div> }<br></div>
<div> <br></div>
<div>+ /* Stereo mode */<br></div>
<div>+ var_Create (aout, "stereo-mode", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);<br></div>
<div>+ var_AddCallback (aout, "stereo-mode", StereoModeCallback, NULL);<br></div>
<div>+ vlc_value_t txt;<br></div>
<div>+ txt.psz_string = _("Stereo audio mode");<br></div>
<div>+ var_Change (aout, "stereo-mode", VLC_VAR_SETTEXT, &txt, NULL);<br></div>
<div>+<br></div>
<div> /* Equalizer */<br></div>
<div> var_Create (aout, "equalizer-preamp", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT);<br></div>
<div> var_Create (aout, "equalizer-bands", VLC_VAR_STRING | VLC_VAR_DOINHERIT);<br></div>
<div>@@ -348,6 +355,7 @@ void aout_Destroy (audio_output_t *aout)<br></div>
<div> var_DelCallback (aout, "mute", var_Copy, aout->obj.parent);<br></div>
<div> var_SetFloat (aout, "volume", -1.f);<br></div>
<div> var_DelCallback (aout, "volume", var_Copy, aout->obj.parent);<br></div>
<div>+ var_DelCallback (aout, "stereo-mode", StereoModeCallback, NULL);<br></div>
<div> vlc_object_release (aout);<br></div>
<div> }<br></div>
<div> <br></div>
<div>@@ -397,8 +405,35 @@ int aout_OutputNew (audio_output_t *aout, audio_sample_format_t *restrict fmt)<br></div>
<div> return -1;<br></div>
<div> }<br></div>
<div> <br></div>
<div>+ /* Fill Stereo mode choices */<br></div>
<div>+ var_Change (aout, "stereo-mode", VLC_VAR_CLEARCHOICES, NULL, NULL);<br></div>
<div>+ vlc_value_t val, txt, default_val;<br></div>
<div>+ val.i_int = 0;<br></div>
<div>+ if (fmt->i_physical_channels == AOUT_CHANS_STEREO)<br></div>
<div>+ {<br></div>
<div>+ if (fmt->i_original_channels & AOUT_CHAN_DOLBYSTEREO)<br></div>
<div>+ {<br></div>
<div>+ default_val.i_int = val.i_int = AOUT_VAR_CHAN_DOLBYS;<br></div>
<div>+ txt.psz_string = _("Dolby Surround");<br></div>
<div>+ }<br></div>
<div>+ else<br></div>
<div>+ {<br></div>
<div>+ default_val.i_int = val.i_int = AOUT_VAR_CHAN_STEREO;<br></div>
<div>+ txt.psz_string = _("Stereo");<br></div>
<div>+ }<br></div>
<div>+ var_Change (aout, "stereo-mode", VLC_VAR_ADDCHOICE, &val, &txt);<br></div>
<div>+ val.i_int = AOUT_VAR_CHAN_LEFT;<br></div>
<div>+ txt.psz_string = _("Left");<br></div>
<div>+ var_Change (aout, "stereo-mode", VLC_VAR_ADDCHOICE, &val, &txt);<br></div>
<div>+ val.i_int = AOUT_VAR_CHAN_RIGHT;<br></div>
<div>+ txt.psz_string = _("Right");<br></div>
<div>+ var_Change (aout, "stereo-mode", VLC_VAR_ADDCHOICE, &val, &txt);<br></div>
<div>+ val.i_int = AOUT_VAR_CHAN_RSTEREO;<br></div>
<div>+ txt.psz_string = _("Reverse stereo");<br></div>
<div>+ var_Change (aout, "stereo-mode", VLC_VAR_ADDCHOICE, &val, &txt);<br></div>
<div>+ }<br></div>
<div>+<br></div>
<div> /* The user may have selected a different channels configuration. */<br></div>
<div>- var_AddCallback (aout, "stereo-mode", StereoModeCallback, NULL);<br></div>
<div> switch (var_GetInteger (aout, "stereo-mode"))<br></div>
<div> {<br></div>
<div> case AOUT_VAR_CHAN_RSTEREO:<br></div>
<div>@@ -417,41 +452,16 @@ int aout_OutputNew (audio_output_t *aout, audio_sample_format_t *restrict fmt)<br></div>
<div> fmt->i_original_channels = AOUT_CHANS_STEREO|AOUT_CHAN_DOLBYSTEREO;<br></div>
<div> break;<br></div>
<div> default:<br></div>
<div>- {<br></div>
<div>- if ((fmt->i_original_channels & AOUT_CHAN_PHYSMASK)<br></div>
<div>- != AOUT_CHANS_STEREO)<br></div>
<div>- break;<br></div>
<div>-<br></div>
<div>- vlc_value_t val, txt;<br></div>
<div>- val.i_int = 0;<br></div>
<div>- var_Change (aout, "stereo-mode", VLC_VAR_DELCHOICE, &val, NULL);<br></div>
<div>- if (fmt->i_original_channels & AOUT_CHAN_DOLBYSTEREO)<br></div>
<div>- {<br></div>
<div>- val.i_int = AOUT_VAR_CHAN_DOLBYS;<br></div>
<div>- txt.psz_string = _("Dolby Surround");<br></div>
<div>- }<br></div>
<div>- else<br></div>
<div>- {<br></div>
<div>- val.i_int = AOUT_VAR_CHAN_STEREO;<br></div>
<div>- txt.psz_string = _("Stereo");<br></div>
<div>- }<br></div>
<div>- var_Change (aout, "stereo-mode", VLC_VAR_ADDCHOICE, &val, &txt);<br></div>
<div>- var_Change (aout, "stereo-mode", VLC_VAR_SETVALUE, &val, NULL);<br></div>
<div>- val.i_int = AOUT_VAR_CHAN_LEFT;<br></div>
<div>- txt.psz_string = _("Left");<br></div>
<div>- var_Change (aout, "stereo-mode", VLC_VAR_ADDCHOICE, &val, &txt);<br></div>
<div> if (fmt->i_original_channels & AOUT_CHAN_DUALMONO)<br></div>
<div> { /* Go directly to the left channel. */<br></div>
<div> fmt->i_original_channels = AOUT_CHAN_LEFT;<br></div>
<div>+ val.i_int = AOUT_VAR_CHAN_LEFT;<br></div>
<div> var_Change (aout, "stereo-mode", VLC_VAR_SETVALUE, &val, NULL);<br></div>
<div> }<br></div>
<div>- val.i_int = AOUT_VAR_CHAN_RIGHT;<br></div>
<div>- txt.psz_string = _("Right");<br></div>
<div>- var_Change (aout, "stereo-mode", VLC_VAR_ADDCHOICE, &val, &txt);<br></div>
<div>- val.i_int = AOUT_VAR_CHAN_RSTEREO;<br></div>
<div>- txt.psz_string = _("Reverse stereo");<br></div>
<div>- var_Change (aout, "stereo-mode", VLC_VAR_ADDCHOICE, &val, &txt);<br></div>
<div>- }<br></div>
<div>+ else<br></div>
<div>+ var_Change (aout, "stereo-mode", VLC_VAR_SETVALUE, &default_val,<br></div>
<div>+ NULL);<br></div>
<div>+ break;<br></div>
<div> }<br></div>
<div> <br></div>
<div> aout_FormatPrepare (fmt);<br></div>
<div>@@ -470,7 +480,6 @@ void aout_OutputDelete (audio_output_t *aout)<br></div>
<div> {<br></div>
<div> aout_OutputAssertLocked (aout);<br></div>
<div> <br></div>
<div>- var_DelCallback (aout, "stereo-mode", StereoModeCallback, NULL);<br></div>
<div> if (aout->stop != NULL)<br></div>
<div> aout->stop (aout);<br></div>
<div> }<br></div>
<div><br></div>
<div><hr><br></div>
<div>vlc-commits mailing list<br></div>
<div>vlc-commits@videolan.org<br></div>
<div><a href="https://mailman.videolan.org/listinfo/vlc-commits">https://mailman.videolan.org/listinfo/vlc-commits</a><br></div>
</pre></blockquote></div>
<div><br></div>
<div>This is very wrong. The setting was always meant for thr current audio track. Reverse stereo or dual-mono are indeed track properties.</div>
</blockquote><div><br></div>
<div>Indeed, it's logical to have this settings per audio track, but as the aout is now restarted very often for X reasons, this settings had no effect at all.<br></div>
<div><br></div>
<div><span style="font-size: 17.145px; line-height: 1.32; letter-spacing: 0.1px;">I'll try to find a better solution.</span></div>
<div><br></div>
<blockquote type="cite"><div> -- <br></div>
<div> Rémi Denis-Courmont<br></div>
<div> Typed on an inconvenient virtual keyboard <br></div>
<div><u>_______________________________________________</u><br></div>
<div>vlc-devel mailing list<br></div>
<div>To unsubscribe or modify your subscription options:<br></div>
<div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div>
</blockquote><div><br></div>
</body>
</html>