<html><head></head><body>This looks racy if the input is being started.<br><br><div class="gmail_quote">Le 1 février 2021 17:52:23 GMT+02:00, Thomas Guillem <thomas@gllm.fr> 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">Select a program id when the input thread is not running.<hr> src/input/input.c | 17 +++++++++++++++++<br> src/input/input_internal.h | 8 ++++++++<br> 2 files changed, 25 insertions(+)<br><br>diff --git a/src/input/input.c b/src/input/input.c<br>index 0319505532..ea64473a0b 100644<br>--- a/src/input/input.c<br>+++ b/src/input/input.c<br>@@ -1814,6 +1814,23 @@ static void ControlInsertDemuxFilter( input_thread_t* p_input, const char* psz_d<br> msg_Dbg(p_input, "Failed to create demux filter %s", psz_demux_chain);<br> }<br> <br>+void input_SetProgramId(input_thread_t *input, int group_id)<br>+<br>+{<br>+ input_thread_private_t *sys = input_priv(input);<br>+<br>+ if (!sys->is_running && !sys->is_stopped)<br>+ {<br>+ /* Not running, send the control synchronously since we are sure that<br>+ * it won't block */<br>+ es_out_Control(sys->p_es_out_display, ES_OUT_SET_GROUP, group_id);<br>+ }<br>+ else<br>+ {<br>+ input_ControlPushHelper(input, INPUT_CONTROL_SET_PROGRAM,<br>+ &(vlc_value_t) { .i_int = group_id });<br>+ }<br>+}<br> <br> void input_SetEsCatIds(input_thread_t *input, enum es_format_category_e cat,<br> const char *str_ids)<br>diff --git a/src/input/input_internal.h b/src/input/input_internal.h<br>index 36b2e8428b..366bf0be3c 100644<br>--- a/src/input/input_internal.h<br>+++ b/src/input/input_internal.h<br>@@ -633,6 +633,14 @@ static inline int input_ControlPushEsHelper( input_thread_t *p_input, int i_type<br> } );<br> }<br> <br>+/**<br>+ * Set the program id<br>+ *<br>+ * cf. ES_OUT_SET_GROUP<br>+ * This function can be called before start or while started.<br>+ */<br>+void input_SetProgramId(input_thread_t *input, int group_id);<br>+<br> /**<br> * Set the list of string ids to enable for a category<br> *</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>