[vlc-devel] [PATCH v3 16/18] video_output: do not wait for new mouse commands if we have a picture ready

Steve Lhomme robux4 at ycbcr.xyz
Tue Aug 18 16:58:43 CEST 2020


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

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 60363fe2d90..8b3354bc5a7 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -476,7 +476,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);
 }
 
@@ -1866,6 +1865,14 @@ static void *Thread(void *object)
             {
                 if (deadline == INVALID_DEADLINE)
                     break;
+
+                picture_t *peek = picture_fifo_Peek(sys->decoder_fifo);
+                if (peek)
+                {
+                    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