[vlc-commits] video_output: keep the displayed.current in frame by frame if next is not ready

Steve Lhomme git at videolan.org
Fri Nov 13 16:52:47 CET 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Nov 10 10:37:42 2020 +0100| [3d13aad3b40c3ff3485ca2f61931162d29c91b4d] | committer: Steve Lhomme

video_output: keep the displayed.current in frame by frame if next is not ready

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3d13aad3b40c3ff3485ca2f61931162d29c91b4d
---

 src/video_output/video_output.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 0107a195a8..0a1d1d29d9 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1487,19 +1487,20 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     bool render_now;
     if (frame_by_frame)
     {
-        picture_Release(sys->displayed.current);
+        picture_t *next;
         if (likely(sys->displayed.next == NULL))
-            sys->displayed.current =
-                ThreadDisplayPreparePicture(vout, false, true, &paused);
+            next = ThreadDisplayPreparePicture(vout, false, true, &paused);
         else
         {
-            sys->displayed.current = sys->displayed.next;
+            next = sys->displayed.next;
             sys->displayed.next = NULL;
         }
 
-        if (!sys->displayed.current)
+        if (next == NULL)
             return VLC_EGENERIC;
 
+        picture_Release(sys->displayed.current);
+        sys->displayed.current = next;
         render_now = true;
     }
     else



More information about the vlc-commits mailing list