<html><head></head><body><div class="gmail_quote">Le 1 juillet 2017 18:24:52 GMT+02:00, Victorien Le Couviour--Tuffet <git@videolan.org> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">vlc | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet@gmail.com> | Fri Jun 23 15:22:44 2017 +0200| [4d35bc81ac6dc6acc5fceadb8baa8574b848494f] | committer: Thomas Guillem<br /><br />vout: add restart proxy callback in case the filter's variable is not a command<br /><br />This allows to remove the brute filter restart HACK from macOS and QT gui.<br /><br />The idea actually comes from Thomas Guillem.<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> <a href="http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4d35bc81ac6dc6acc5fceadb8baa8574b848494f">http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4d35bc81ac6dc6acc5fceadb8baa8574b848494f</a><br /></blockquote>---<br /><br /> src/video_output/control.c | 2 +-<br /> src/video_output/video_output.c | 35 +++++++++++++++++++++++++----------<br /> 2 files changed, 26 insertions(+), 11 deletions(-)<br /><br />diff --git a/src/video_output/control.c b/src/video_output/control.c<br />index bbdb8948eb..e4cca29d2a 100644<br />--- a/src/video_output/control.c<br />+++ b/src/video_output/control.c<br />@@ -172,7 +172,7 @@ void vout_control_PushString(vout_control_t *ctrl, int type, const char *string)<br /> vout_control_cmd_t cmd;<br /> <br /> vout_control_cmd_Init(&cmd, type);<br />- cmd.u.string = strdup(string);<br />+ cmd.u.string = string ? strdup(string) : NULL;<br /> vout_control_Push(ctrl, &cmd);<br /> }<br /> <br />diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c<br />index e46859ddd1..41c3d892fe 100644<br />--- a/src/video_output/video_output.c<br />+++ b/src/video_output/video_output.c<br />@@ -660,6 +660,15 @@ static int FilterProxyCallback(vlc_object_t *p_this, char const *psz_var,<br /> return 0;<br /> }<br /> <br />+static int FilterRestartCallback(vlc_object_t *p_this, char const *psz_var,<br />+ vlc_value_t oldval, vlc_value_t newval,<br />+ void *p_data)<br />+{<br />+ (void) p_this; (void) psz_var; (void) oldval; (void) newval;<br />+ vout_ControlChangeFilters((vout_thread_t *)p_data, NULL);<br />+ return 0;<br />+}<br />+<br /> static void ThreadAddFilterCallbacks(vout_thread_t *vout, filter_t *filter)<br /> {<br /> /* Duplicate every command variables from the filter, and add a proxy<br />@@ -673,12 +682,12 @@ static void ThreadAddFilterCallbacks(vout_thread_t *vout, filter_t *filter)<br /> {<br /> char *name = *pname;<br /> int var_type = var_Type(filter, name);<br />+ assert(var_Type(vout, name) == 0);<br />+ var_Create(vout, name, var_type | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND);<br /> if ((var_type & VLC_VAR_ISCOMMAND))<br />- {<br />- assert(var_Type(vout, name) == 0);<br />- var_Create(vout, name, var_type | VLC_VAR_DOINHERIT);<br /> var_AddCallback(vout, name, FilterProxyCallback, filter);<br />- }<br />+ else<br />+ var_AddCallback(vout, name, FilterRestartCallback, vout);<br /> free(name);<br /> }<br /> free(names);<br />@@ -694,12 +703,15 @@ static int ThreadDelFilterCallbacks(filter_t *filter, void *opaque)<br /> for (char **pname = names; *pname != NULL; pname++)<br /> {<br /> char *name = *pname;<br />- int var_type = var_Type(filter, name);<br />- if ((var_type & VLC_VAR_ISCOMMAND))<br />- {<br />+ int var_type = var_Type(vout, name);<br />+ assert(var_type & VLC_VAR_ISCOMMAND);<br />+ int filter_var_type = var_Type(filter, name);<br />+<br />+ if (filter_var_type & VLC_VAR_ISCOMMAND)<br /> var_DelCallback(vout, name, FilterProxyCallback, filter);<br />- var_Destroy(vout, name);<br />- }<br />+ else if (filter_var_type)<br />+ var_DelCallback(vout, name, FilterRestartCallback, vout);<br />+ var_Destroy(vout, name);<br /> free(name);<br /> }<br /> free(names);<br />@@ -1651,7 +1663,10 @@ static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)<br /> ThreadDisplayOsdTitle(vout, cmd.u.string);<br /> break;<br /> case VOUT_CONTROL_CHANGE_FILTERS:<br />- ThreadChangeFilters(vout, NULL, cmd.u.string, -1, false);<br />+ ThreadChangeFilters(vout, NULL,<br />+ cmd.u.string != NULL ?<br />+ cmd.u.string : vout->p->filter.configuration,<br />+ -1, false);<br /> break;<br /> case VOUT_CONTROL_CHANGE_INTERLACE:<br /> ThreadChangeFilters(vout, NULL, vout->p->filter.configuration,<br /><br /><hr /><br />vlc-commits mailing list<br />vlc-commits@videolan.org<br /><a href="https://mailman.videolan.org/listinfo/vlc-commits">https://mailman.videolan.org/listinfo/vlc-commits</a><br /></pre></blockquote></div><br clear="all">Repeating myselg but this makes no sense whatsoever. The command bit has nothing to do with needing to restart.<br>
-- <br>
Rémi Denis-Courmont<br>
Typed on an inconvenient virtual keyboard</body></html>