<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style>
</head>
<body><div>On Thu, May 17, 2018, at 15:11, Rémi Denis-Courmont wrote:<br></div>
<blockquote type="cite"><div>I agree that there is a problem at least in principles, but this seems too naive solution.<br></div>
<div> <br></div>
<div> For instance, aout does not allow queuing while paused.<br></div>
</blockquote><div><br></div>
<div>I don't think we have asynchronous audio decoders yet.<br></div>
<div>The problem is mainly for the vout and asynchronous video decoders.<br></div>
<div><br></div>
<div>For 4.0: I think the input/decoder.c should initialize its vout/aout during the creation (from the ressource manager). Both vout/aout should be reconfigurable (that is already the case for aout) and stay const during the lifetime of the decoder.<br></div>
<div><br></div>
<div>This current issue will be fixed by this solution then.<br></div>
<div><br></div>
<blockquote type="cite"><div><br></div>
<div defang_data-gmailquote="yes"><div>Le 17 mai 2018 16:06:32 GMT+03:00, Thomas Guillem <thomas@gllm.fr> 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-color:rgb(204, 204, 204);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><pre><div>Since these variables can be written from any thread from format_update()<br></div>
<div>callbacks.<br></div>
<div>---<br></div>
<div> src/input/decoder.c | 10 +++++++---<br></div>
<div> 1 file changed, 7 insertions(+), 3 deletions(-)<br></div>
<div><br></div>
<div>diff --git a/src/input/decoder.c b/src/input/decoder.c<br></div>
<div>index 1fdc4fb7ed..f80a799723 100644<br></div>
<div>--- a/src/input/decoder.c<br></div>
<div>+++ b/src/input/decoder.c<br></div>
<div>@@ -103,10 +103,10 @@ struct decoder_owner<br></div>
<div>     vlc_cond_t  wait_fifo; /* TODO: merge with wait_acknowledge */<br></div>
<div>     vlc_cond_t  wait_timed;<br></div>
<div> <br></div>
<div>-    /* -- These variables need locking on write(only) -- */<br></div>
<div>+    /* These variables are written from the format_update() callbacks threads.<br></div>
<div>+     * They need locking when they are read from the DecoderThread. */<br></div>
<div>     audio_output_t *p_aout;<br></div>
<div>-<br></div>
<div>-    vout_thread_t   *p_vout;<br></div>
<div>+    vout_thread_t  *p_vout;<br></div>
<div> <br></div>
<div>     /* -- Theses variables need locking on read *and* write -- */<br></div>
<div>     /* Preroll */<br></div>
<div>@@ -1535,6 +1535,7 @@ static void *DecoderThread( void *p_data )<br></div>
<div> <br></div>
<div>             /* NOTE: Only the audio and video outputs care about pause. */<br></div>
<div>             msg_Dbg( p_dec, "toggling %s", paused ? "resume" : "pause" );<br></div>
<div>+            vlc_mutex_lock( &p_owner->lock );<br></div>
<div>             switch( p_dec->fmt_out.i_cat )<br></div>
<div>             {<br></div>
<div>                 case VIDEO_ES:<br></div>
<div>@@ -1550,6 +1551,7 @@ static void *DecoderThread( void *p_data )<br></div>
<div>                 default:<br></div>
<div>                     vlc_assert_unreachable();<br></div>
<div>             }<br></div>
<div>+            vlc_mutex_unlock( &p_owner->lock );<br></div>
<div> <br></div>
<div>             vlc_restorecancel( canc );<br></div>
<div>             vlc_fifo_Lock( p_owner->p_fifo );<br></div>
<div>@@ -1569,8 +1571,10 @@ static void *DecoderThread( void *p_data )<br></div>
<div>                 case VIDEO_ES:<br></div>
<div>                     break;<br></div>
<div>                 case AUDIO_ES:<br></div>
<div>+                    vlc_mutex_lock( &p_owner->lock );<br></div>
<div>                     if( p_owner->p_aout != NULL )<br></div>
<div>                         aout_DecChangeRate( p_owner->p_aout, rate );<br></div>
<div>+                    vlc_mutex_unlock( &p_owner->lock );<br></div>
<div>                     break;<br></div>
<div>                 case SPU_ES:<br></div>
<div>                     break;<br></div>
</pre></blockquote></div>
<div><br></div>
<div>--<br></div>
<div> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. <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>