[vlc-devel] [PATCH v3 6/8] video_output: move the first picture reading in frame by frame/regular code

Steve Lhomme robux4 at ycbcr.xyz
Wed Nov 18 12:56:16 CET 2020


In frame by frame we already read the picture to put it in displayed.current no
matter what. But it was actually doing it twice for the first picture, possibly
missing the first picture.
---
 src/video_output/video_output.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index d010c9be6f0..992ea095d01 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1468,19 +1468,11 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     if (deadline)
         *deadline = VLC_TICK_INVALID;
 
-    if (!sys->displayed.current)
-    {
-        sys->displayed.current =
-            ThreadDisplayPreparePicture(vout, true, frame_by_frame, &paused);
-        if (!sys->displayed.current)
-            return VLC_EGENERIC; // wait with no known deadline
-    }
-
     bool render_now;
     if (frame_by_frame)
     {
         picture_t *next;
-        next = ThreadDisplayPreparePicture(vout, false, true, &paused);
+        next = ThreadDisplayPreparePicture(vout, first, true, &paused);
         if (next == NULL)
             return VLC_EGENERIC;
 
@@ -1492,6 +1484,14 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     }
     else
     {
+        if (first)
+        {
+            sys->displayed.current =
+                ThreadDisplayPreparePicture(vout, first, false, &paused);
+            if (!sys->displayed.current)
+                return VLC_EGENERIC; // wait with no known deadline
+        }
+
         const vlc_tick_t system_now = vlc_tick_now();
         const vlc_tick_t render_delay = vout_chrono_GetHigh(&sys->render) + VOUT_MWAIT_TOLERANCE;
 
-- 
2.26.2



More information about the vlc-devel mailing list