[vlc-devel] [PATCH v4 20/23] video_output: do not wait for new mouse commands if we have a picture ready

Steve Lhomme robux4 at ycbcr.xyz
Fri Aug 21 11:59:38 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 2e2ec1e5642..b13e0371482 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -507,7 +507,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);
 }
 
@@ -1865,6 +1864,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