<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div><br></div><div><br></div><div>On Sun, Feb 2, 2020, at 11:16, Rémi Denis-Courmont wrote:<br></div><blockquote type="cite" id="qt"><div>Can we read 'paused' without lock in this case?<br></div></blockquote><div><br></div><div>Yes we wan, and it's already done like that. The extra lock is only needed to get the vout, and acquired only when flushing paused. </div><div><br></div><blockquote type="cite" id="qt"><div><br></div><div class="qt-gmail_quote"><div>Le 31 janvier 2020 14:11:19 GMT+01:00, Thomas Guillem <thomas@gllm.fr> a écrit :<br></div><blockquote style="margin-top:0pt;margin-right:0pt;margin-bottom:0pt;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;" class="qt-gmail_quote"><pre class="qt-k9mail"><div>cf. comment.<hr> src/input/decoder.c | 20 ++++++++++++++++++++<br></div><div> 1 file changed, 20 insertions(+)<br></div><div><br></div><div>diff --git a/src/input/decoder.c b/src/input/decoder.c<br></div><div>index 251be905926..1d90e60e200 100644<br></div><div>--- a/src/input/decoder.c<br></div><div>+++ b/src/input/decoder.c<br></div><div>@@ -2337,6 +2337,26 @@ void input_DecoderFlush( decoder_t *p_dec )<br></div><div>     vlc_fifo_Signal( p_owner->p_fifo );<br></div><div> <br></div><div>     vlc_fifo_Unlock( p_owner->p_fifo );<br></div><div>+<br></div><div>+    if( p_owner->paused )<br></div><div>+    {<br></div><div>+        /* The DecoderThread could be stuck if pf_decode(). This is likely the<br></div><div>+         * case with paused asynchronous decoder modules that have a limited<br></div><div>+         * input and output pool size. Indeed, with such decoders, you have to<br></div><div>+         * release an output buffer to get an input buffer. So, when paused and<br></div><div>+         * flushed, the DecoderThread could be waiting for an output buffer to<br></div><div>+         * be released (or rendered). In that case, the DecoderThread will<br></div><div>+         * never be flushed since it be never leave pf_decode(). To fix this<br></div><div>+         * issue, pre-flush the vout from here. The vout will have to be<br></div><div>+         * flushed again since the module could be outputting more buffers just<br></div><div>+         * after being unstuck. */<br></div><div>+<br></div><div>+        vlc_mutex_lock( &p_owner->lock );<br></div><div>+        if( p_dec->fmt_out.i_cat == VIDEO_ES<br></div><div>+         && p_owner->p_vout && p_owner->vout_thread_started )<br></div><div>+            vout_FlushAll( p_owner->p_vout );<br></div><div>+        vlc_mutex_unlock( &p_owner->lock );<br></div><div>+    }<br></div><div> }<br></div><div> <br></div><div> void input_DecoderGetCcDesc( decoder_t *p_dec, decoder_cc_desc_t *p_desc )<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>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div>https://mailman.videolan.org/listinfo/vlc-devel<br></div></blockquote><div><br></div></body></html>