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

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to