[FFmpeg-cvslog] mov: fix seek to next root atom in fragmented mp4

John Stebbins git at videolan.org
Sat Apr 11 19:24:26 EEST 2020


ffmpeg | branch: master | John Stebbins <jstebbins at jetheaddev.com> | Sun Mar 29 13:32:45 2020 -0700| [21a65d63109628276a8fa88f8e6a106696506dc9] | committer: Michael Niedermayer

mov: fix seek to next root atom in fragmented mp4

If some but not all moof's are referenced in an sidx, whole fragments
were being skipped.

Fixes tickets 7377, 7389, and 8502

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21a65d63109628276a8fa88f8e6a106696506dc9
---

 libavformat/mov.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 32f51e6a4c..eb9a8714a0 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7734,7 +7734,8 @@ static int mov_switch_root(AVFormatContext *s, int64_t target, int index)
     mov->next_root_atom = 0;
     if (index < 0 || index >= mov->frag_index.nb_items)
         index = search_frag_moof_offset(&mov->frag_index, target);
-    if (index < mov->frag_index.nb_items) {
+    if (index < mov->frag_index.nb_items &&
+        mov->frag_index.item[index].moof_offset == target) {
         if (index + 1 < mov->frag_index.nb_items)
             mov->next_root_atom = mov->frag_index.item[index + 1].moof_offset;
         if (mov->frag_index.item[index].headers_read)



More information about the ffmpeg-cvslog mailing list