]> git.sesse.net Git - ffmpeg/commitdiff
avformat/mov: Handle when we have an mfra box but have not read the full sidx for...
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>
Mon, 15 Mar 2021 14:20:17 +0000 (14:20 +0000)
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>
Wed, 17 Mar 2021 14:46:48 +0000 (14:46 +0000)
Use the tfra timestamp if it is available and sidx timestamp is not.

Fixes reading the entire file after seeking in a live-style DASH FMP4
with an MFRA.

This specifically fixes when use_mfra_for is set.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
libavformat/mov.c

index 23b0ead01ed49c74ba151bb5961009ec7f7d00f6..97857789f49f3087cfd2beae8a65d6d3e5938a6a 100644 (file)
@@ -1279,6 +1279,10 @@ static int64_t get_frag_time(MOVFragmentIndex *frag_index,
 
     if (track_id >= 0) {
         frag_stream_info = get_frag_stream_info(frag_index, index, track_id);
+        if (frag_stream_info->sidx_pts != AV_NOPTS_VALUE)
+            return frag_stream_info->sidx_pts;
+        if (frag_stream_info->first_tfra_pts != AV_NOPTS_VALUE)
+            return frag_stream_info->first_tfra_pts;
         return frag_stream_info->sidx_pts;
     }