<html><head></head><body>I agree that there is a problem at least in principles, but this seems too naive solution.<br>
<br>
For instance, aout does not allow queuing while paused.<br><br><div class="gmail_quote">Le 17 mai 2018 16:06:32 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">Since these variables can be written from any thread from format_update()<br>callbacks.<br>---<br> src/input/decoder.c | 10 +++++++---<br> 1 file changed, 7 insertions(+), 3 deletions(-)<br><br>diff --git a/src/input/decoder.c b/src/input/decoder.c<br>index 1fdc4fb7ed..f80a799723 100644<br>--- a/src/input/decoder.c<br>+++ b/src/input/decoder.c<br>@@ -103,10 +103,10 @@ struct decoder_owner<br>     vlc_cond_t  wait_fifo; /* TODO: merge with wait_acknowledge */<br>     vlc_cond_t  wait_timed;<br> <br>-    /* -- These variables need locking on write(only) -- */<br>+    /* These variables are written from the format_update() callbacks threads.<br>+     * They need locking when they are read from the DecoderThread. */<br>     audio_output_t *p_aout;<br>-<br>-    vout_thread_t   *p_vout;<br>+    vout_thread_t  *p_vout;<br> <br>     /* -- Theses variables need locking on read *and* write -- */<br>     /* Preroll */<br>@@ -1535,6 +1535,7 @@ static void *DecoderThread( void *p_data )<br> <br>             /* NOTE: Only the audio and video outputs care about pause. */<br>             msg_Dbg( p_dec, "toggling %s", paused ? "resume" : "pause" );<br>+            vlc_mutex_lock( &p_owner->lock );<br>             switch( p_dec->fmt_out.i_cat )<br>             {<br>                 case VIDEO_ES:<br>@@ -1550,6 +1551,7 @@ static void *DecoderThread( void *p_data )<br>                 default:<br>                     vlc_assert_unreachable();<br>             }<br>+            vlc_mutex_unlock( &p_owner->lock );<br> <br>             vlc_restorecancel( canc );<br>             vlc_fifo_Lock( p_owner->p_fifo );<br>@@ -1569,8 +1571,10 @@ static void *DecoderThread( void *p_data )<br>                 case VIDEO_ES:<br>                     break;<br>                 case AUDIO_ES:<br>+                    vlc_mutex_lock( &p_owner->lock );<br>                     if( p_owner->p_aout != NULL )<br>                         aout_DecChangeRate( p_owner->p_aout, rate );<br>+                    vlc_mutex_unlock( &p_owner->lock );<br>                     break;<br>                 case SPU_ES:<br>                     break;</pre></blockquote></div><br>
-- <br>
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>