[vlc-devel] [PATCH v5 22/24] video_output: do not wait for new mouse commands if we have a picture ready

Steve Lhomme robux4 at ycbcr.xyz
Mon Aug 24 09:42:03 CEST 2020


This is what vout_control_Wake() was doing.
---
 src/video_output/video_output.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index e876b89d7ef..b37985e10b8 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -499,7 +499,6 @@ void vout_PutPicture(vout_thread_t *vout, picture_t *picture)
     vlc_mutex_lock(&sys->control_lock);
     picture_fifo_Push(sys->decoder_fifo, picture);
     vlc_cond_signal(&sys->has_pictures);
-    vout_control_Wake(&sys->control);
     vlc_mutex_unlock(&sys->control_lock);
 }
 
@@ -1864,6 +1863,15 @@ static void *Thread(void *object)
                 // no more pending mouse events, we may wait for more
                 if (!wait)
                     break;
+
+                picture_t *peek = picture_fifo_Peek(sys->decoder_fifo);
+                if (peek)
+                {
+                    // we have a picture, don't wait and process it
+                    picture_Release(peek);
+                    break;
+                }
+
                 vlc_cond_timedwait(&sys->has_pictures, &sys->control_lock, deadline);
 
                 if (sys->mouse_events.i_size <= 0)
-- 
2.26.2



More information about the vlc-devel mailing list