summaryrefslogtreecommitdiff
path: root/libavformat/isom.h
diff options
context:
space:
mode:
authorJohn Stebbins <jstebbins@jetheaddev.com>2017-10-12 10:59:23 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2017-10-23 12:41:04 +0200
commit4a9d32baca3af0d1831f9556a922c7ab5b426b10 (patch)
tree6e812cf4905d1da7b169878dd4611046428a6b10 /libavformat/isom.h
parent2b320318273b74df6e1b712fb33544d6a1b26be1 (diff)
downloadffmpeg-4a9d32baca3af0d1831f9556a922c7ab5b426b10.tar.gz
mov: fix decode of fragments that overlap in time
When keyframe intervals of dash segments are not perfectly aligned, fragments in the stream can overlap in time. The previous sorting by timestamp causes packets to be read out of decode order and results in decode errors. Insert new "trun" index entries into index_entries in the order that the trun are referenced by the sidx. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/isom.h')
-rw-r--r--libavformat/isom.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/libavformat/isom.h b/libavformat/isom.h
index b9380e9dcc..395d20d25c 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -93,7 +93,6 @@ typedef struct MOVFragment {
unsigned duration;
unsigned size;
unsigned flags;
- int64_t time;
} MOVFragment;
typedef struct MOVTrackExt {
@@ -109,17 +108,28 @@ typedef struct MOVSbgp {
unsigned int index;
} MOVSbgp;
+typedef struct MOVFragmentStreamInfo {
+ int id;
+ int64_t sidx_pts;
+ int64_t first_tfra_pts;
+ int64_t tfdt_dts;
+ int index_entry;
+} MOVFragmentStreamInfo;
+
typedef struct MOVFragmentIndexItem {
int64_t moof_offset;
- int64_t time;
int headers_read;
+ int current;
+ int nb_stream_info;
+ MOVFragmentStreamInfo * stream_info;
} MOVFragmentIndexItem;
typedef struct MOVFragmentIndex {
- unsigned track_id;
- unsigned item_count;
- unsigned current_item;
- MOVFragmentIndexItem *items;
+ int allocated_size;
+ int complete;
+ int current;
+ int nb_items;
+ MOVFragmentIndexItem * item;
} MOVFragmentIndex;
typedef struct MOVIndexRange {
@@ -250,9 +260,7 @@ typedef struct MOVContext {
int moov_retry;
int use_mfra_for;
int has_looked_for_mfra;
- MOVFragmentIndex** fragment_index_data;
- unsigned fragment_index_count;
- int fragment_index_complete;
+ MOVFragmentIndex frag_index;
int atom_depth;
unsigned int aax_mode; ///< 'aax' file has been detected
uint8_t file_key[20];