[FFmpeg-devel] [PATCH] avformat/mov.c: trun atom sample should be logged from 0

Valerii Zapodovnikov val.zapod.vz at gmail.com
Sat Jun 5 16:54:46 EEST 2021


Just like for stss atom.

Suggested-By: Nick Ryan <nick.paul.ryan at gmail.com>
---
 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index c088c9f515..1be2783556 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4936,11 +4936,11 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
         sc->ctts_data[index_entry_pos].count = 1;
         sc->ctts_data[index_entry_pos].duration = ctts_duration;
-        index_entry_pos++;
 
         av_log(c->fc, AV_LOG_TRACE, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
                 "size %u, distance %d, keyframe %d\n", st->index,
                 index_entry_pos, offset, dts, sample_size, distance, keyframe);
+        index_entry_pos++;
         distance++;
         dts += sample_duration;
         offset += sample_size;
-- 
2.30.2



More information about the ffmpeg-devel mailing list