[vlc-devel] [PATCH v2 07/18] video_output: remove decoded timestamp variable

Steve Lhomme robux4 at ycbcr.xyz
Tue Nov 24 11:46:30 CET 2020


It was always set when displayed.decoded was set. So we use displayed.decoded
directly.
---
 src/video_output/video_output.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 992ea095d01..0d04975f50e 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -122,7 +122,6 @@ typedef struct vout_thread_sys_t
 
     struct {
         vlc_tick_t  date;
-        vlc_tick_t  timestamp;
         bool        is_interlaced;
         picture_t   *decoded; // decoded picture before passed through chain_static
         picture_t   *current;
@@ -1130,7 +1129,6 @@ static picture_t *ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reus
             picture_Release(sys->displayed.decoded);
 
         sys->displayed.decoded       = picture_Hold(decoded);
-        sys->displayed.timestamp     = decoded->date;
         sys->displayed.is_interlaced = !decoded->b_progressive;
 
         picture = filter_chain_VideoFilter(sys->filter.chain_static, sys->displayed.decoded);
@@ -1609,7 +1607,6 @@ static void vout_FlushUnlocked(vout_thread_sys_t *vout, bool below,
 
             sys->displayed.decoded   = NULL;
             sys->displayed.date      = VLC_TICK_INVALID;
-            sys->displayed.timestamp = VLC_TICK_INVALID;
         }
     }
 
@@ -1644,11 +1641,11 @@ void vout_NextPicture(vout_thread_t *vout, vlc_tick_t *duration)
     *duration = 0;
 
     vout_control_Hold(&sys->control);
-    if (sys->step.last == VLC_TICK_INVALID)
-        sys->step.last = sys->displayed.timestamp;
+    if (sys->step.last == VLC_TICK_INVALID && sys->displayed.decoded)
+        sys->step.last = sys->displayed.decoded->date;
 
     if (ThreadDisplayPicture(sys, NULL) == 0) {
-        sys->step.timestamp = sys->displayed.timestamp;
+        sys->step.timestamp = sys->displayed.decoded->date;
 
         if (sys->step.last != VLC_TICK_INVALID &&
             sys->step.timestamp > sys->step.last) {
@@ -1832,7 +1829,6 @@ static int vout_Start(vout_thread_sys_t *vout, vlc_video_context *vctx, const vo
     sys->displayed.current       = NULL;
     sys->displayed.decoded       = NULL;
     sys->displayed.date          = VLC_TICK_INVALID;
-    sys->displayed.timestamp     = VLC_TICK_INVALID;
     sys->displayed.is_interlaced = false;
 
     sys->step.last               = VLC_TICK_INVALID;
-- 
2.26.2



More information about the vlc-devel mailing list