<html><head></head><body>Hi,<br><br>This conflicts with Romain's series. I don't have an opinion, but someone will need to yield.<br><br><div class="gmail_quote">Le 20 juin 2019 18:23:54 GMT+03: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"><hr> src/input/decoder.c | 39 +++++++++++++++++++++++++++++++-------<br> src/input/event.h | 9 +++++++++<br> src/input/input_internal.h | 12 ++++++++++++<br> 3 files changed, 53 insertions(+), 7 deletions(-)<br><br>diff --git a/src/input/decoder.c b/src/input/decoder.c<br>index 3a47c01ddf..ea9373975b 100644<br>--- a/src/input/decoder.c<br>+++ b/src/input/decoder.c<br>@@ -611,12 +611,19 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,<br> msg_Warn( p_dec, "no vout found, dropping subpicture" );<br> if( p_owner->p_vout )<br> {<br>- if (p_owner->i_spu_channel != -1)<br>- {<br>- vout_UnregisterSubpictureChannel(p_owner->p_vout,<br>- p_owner->i_spu_channel);<br>- p_owner->i_spu_channel = -1;<br>- }<br>+ assert(p_owner->i_spu_channel != -1);<br>+<br>+ if (p_owner->p_input)<br>+ input_SendEventSpu(p_owner->p_input,<br>+ &(struct vlc_input_event_spu) {<br>+ .vout = p_owner->p_vout,<br>+ .channel_order = VLC_SPU_CHANNEL_ORDER_NONE,<br>+ .id = p_owner->id,<br>+ });<br>+<br>+ vout_UnregisterSubpictureChannel(p_owner->p_vout,<br>+ p_owner->i_spu_channel);<br>+ p_owner->i_spu_channel = -1;<br> <br> vlc_mutex_lock( &p_owner->lock );<br> vout_Release(p_owner->p_vout);<br>@@ -629,13 +636,15 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,<br> if( p_owner->p_vout != p_vout )<br> {<br> ssize_t old_spu_channel = p_owner->i_spu_channel;<br>+ enum vlc_spu_channel_order channel_order;<br> p_owner->i_spu_channel =<br> vout_RegisterSubpictureChannelInternal(p_vout, p_owner->p_clock,<br>- NULL);<br>+ &channel_order);<br> p_owner->i_spu_order = 0;<br> <br> if (p_owner->i_spu_channel != -1)<br> {<br>+ assert(channel_order != VLC_SPU_CHANNEL_ORDER_NONE);<br> if (p_owner->p_vout && old_spu_channel != -1)<br> vout_UnregisterSubpictureChannel(p_owner->p_vout,<br> old_spu_channel);<br>@@ -644,6 +653,14 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,<br> vout_Release(p_owner->p_vout);<br> p_owner->p_vout = p_vout;<br> vlc_mutex_unlock(&p_owner->lock);<br>+<br>+ if (p_owner->p_input)<br>+ input_SendEventSpu(p_owner->p_input,<br>+ &(struct vlc_input_event_spu) {<br>+ .vout = p_vout,<br>+ .channel_order = channel_order,<br>+ .id = p_owner->id,<br>+ });<br> }<br> }<br> else<br>@@ -1991,6 +2008,14 @@ static void DeleteDecoder( decoder_t * p_dec )<br> if( p_owner->p_vout )<br> {<br> assert( p_owner->i_spu_channel > 0 );<br>+ if (p_owner->p_input)<br>+ input_SendEventSpu(p_owner->p_input,<br>+ &(struct vlc_input_event_spu) {<br>+ .vout = p_owner->p_vout,<br>+ .channel_order = VLC_SPU_CHANNEL_ORDER_NONE,<br>+ .id = p_owner->id,<br>+ });<br>+<br> vout_UnregisterSubpictureChannel( p_owner->p_vout,<br> p_owner->i_spu_channel );<br> vout_Release(p_owner->p_vout);<br>diff --git a/src/input/event.h b/src/input/event.h<br>index 01163c479a..467d4ee799 100644<br>--- a/src/input/event.h<br>+++ b/src/input/event.h<br>@@ -281,6 +281,15 @@ static inline void input_SendEventVout(input_thread_t *p_input,<br> });<br> }<br> <br>+static inline void input_SendEventSpu(input_thread_t *p_input,<br>+ const struct vlc_input_event_spu *event)<br>+{<br>+ input_SendEvent(p_input, &(struct vlc_input_event) {<br>+ .type = INPUT_EVENT_SPU,<br>+ .spu = *event,<br>+ });<br>+}<br>+<br> /*****************************************************************************<br> * Event for control.c/input.c<br> *****************************************************************************/<br>diff --git a/src/input/input_internal.h b/src/input/input_internal.h<br>index b159033b1c..b68ad77b4f 100644<br>--- a/src/input/input_internal.h<br>+++ b/src/input/input_internal.h<br>@@ -169,6 +169,9 @@ typedef enum input_event_type_e<br> /* A vout_thread_t object has been created/deleted by *the input* */<br> INPUT_EVENT_VOUT,<br> <br>+ /* A new SPU channel has been registered/unregistered */<br>+ INPUT_EVENT_SPU,<br>+<br> /* (pre-)parsing events */<br> INPUT_EVENT_SUBITEMS,<br> <br>@@ -271,6 +274,13 @@ struct vlc_input_event_vout<br> vlc_es_id_t *id;<br> };<br> <br>+struct vlc_input_event_spu<br>+{<br>+ vout_thread_t *vout;<br>+ enum vlc_spu_channel_order channel_order;<br>+ vlc_es_id_t *id;<br>+};<br>+<br> struct vlc_input_event<br> {<br> input_event_type_e type;<br>@@ -304,6 +314,8 @@ struct vlc_input_event<br> float cache;<br> /* INPUT_EVENT_VOUT */<br> struct vlc_input_event_vout vout;<br>+ /* INPUT_EVENT_SPU */<br>+ struct vlc_input_event_spu spu;<br> /* INPUT_EVENT_SUBITEMS */<br> input_item_node_t *subitems;<br> /* INPUT_EVENT_VBI_PAGE */</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>