Commit 4a9d32ba authored by John Stebbins's avatar John Stebbins Committed by Michael Niedermayer

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 2b320318
......@@ -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];
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment