[vlc-devel] [PATCH] video_output: keep the decoded timestamp fresh from the decoder

Steve Lhomme robux4 at ycbcr.xyz
Fri Oct 16 11:58:08 CEST 2020


The timestamp is used as the basis for "step display". It is used to estimate
the duration of frames (between the current and previous frame). It doesn't
need to be shifted to the system clock, especially in pause.

This duration is used to estimate how much extra buffering is needed from the
source so we shouldn't involve the system clock at all.
---
 src/video_output/video_output.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index e93acb2315b..7ca18491e05 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1078,6 +1078,8 @@ static int ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reuse,
             decoded = picture_fifo_Pop(sys->decoder_fifo);
 
             if (decoded) {
+                sys->displayed.timestamp = decoded->date;
+
                 if (is_late_dropped && !decoded->b_force) {
                     const vlc_tick_t system_now = vlc_tick_now();
                     const vlc_tick_t system_pts =
@@ -1135,7 +1137,6 @@ static int ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reuse,
             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, decoded);
-- 
2.26.2



More information about the vlc-devel mailing list