[FFmpeg-devel] [PATCH] avformat/matroskadec: update the end timestamp when there is a timestamp

Steve Lhomme robux4 at ycbcr.xyz
Sun Nov 15 11:00:12 EET 2020


No need to check if the cluster has a timestamp or not. If we found a timestamp
for this block, then it's usable. This is actually the same condition to decide
if we can use the timestamp or not.
---
 libavformat/matroskadec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 137674c068..8a5bc4018a 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -3626,7 +3626,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf
     if (!block_duration && trust_default_duration)
         block_duration = track->default_duration * laces / matroska->time_scale;
 
-    if (cluster_time != (uint64_t)-1 && (block_time >= 0 || cluster_time >= -block_time))
+    if (timecode != AV_NOPTS_VALUE)
         track->end_timecode =
             FFMAX(track->end_timecode, timecode + block_duration);
 
-- 
2.26.2



More information about the ffmpeg-devel mailing list