diff mbox series

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

Message ID 20201115090012.26055-1-robux4@ycbcr.xyz
State New
Headers show
Series [FFmpeg-devel] avformat/matroskadec: update the end timestamp when there is a timestamp
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Steve Lhomme Nov. 15, 2020, 9 a.m. UTC
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 mbox series

Patch

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);