<html><head></head><body>+1<br><br>This probably be separated better from normal decoding.<br><br><div class="gmail_quote">Le 2 octobre 2019 08:53:24 GMT+03:00, Steve Lhomme <robux4@ycbcr.xyz> 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">Maybe an atomic bool would be more appropriate  ?<br><br>On 2019-10-01 18:33, Hugo Beauzée-Luyssen wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><hr>  src/input/decoder.c | 17 +++++++++++++----<br>  1 file changed, 13 insertions(+), 4 deletions(-)<br><br>diff --git a/src/input/decoder.c b/src/input/decoder.c<br>index 57c9de6a1e..bb1beca38d 100644<br>--- a/src/input/decoder.c<br>+++ b/src/input/decoder.c<br>@@ -1101,19 +1101,28 @@ static picture_t *thumbnailer_buffer_new( decoder_t *p_dec )<br>      struct decoder_owner *p_owner = dec_get_owner( p_dec );<br>      /* Avoid decoding more than one frame when a thumbnail was<br>       * already generated */<br>+    vlc_mutex_lock( &p_owner->lock );<br>      if( !p_owner->b_first )<br>+    {<br>+        vlc_mutex_unlock( &p_owner->lock );<br>          return NULL;<br>+    }<br>+    vlc_mutex_unlock( &p_owner->lock );<br>      return picture_NewFromFormat( &p_dec->fmt_out.video );<br>  }<br>  <br>  static void ModuleThread_QueueThumbnail( decoder_t *p_dec, picture_t *p_pic )<br>  {<br>      struct decoder_owner *p_owner = dec_get_owner( p_dec );<br>-    if( p_owner->b_first )<br>-    {<br>+    bool b_first;<br>+<br>+    vlc_mutex_lock( &p_owner->lock );<br>+    b_first = p_owner->b_first;<br>+    p_owner->b_first = false;<br>+    vlc_mutex_unlock( &p_owner->lock );<br>+<br>+    if( b_first )<br>          decoder_Notify(p_owner, on_thumbnail_ready, p_pic);<br>-        p_owner->b_first = false;<br>-    }<br>      picture_Release( p_pic );<br>  <br>  }<br>-- <br>2.20.1<hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>