diff options
author | Tomas Härdin <tomas.hardin@codemill.se> | 2011-12-19 11:00:14 +0100 |
---|---|---|
committer | Tomas Härdin <tomas.hardin@codemill.se> | 2011-12-20 09:18:44 +0100 |
commit | 085249a37951046ef3e0556e4ccac2390afd9764 (patch) | |
tree | fb3ea110d671750c69ade73d9027b7154032916b /libavformat/mxfdec.c | |
parent | 0edf7ebcd6703e3eb3b12bf0818796574d661ae3 (diff) | |
download | ffmpeg-085249a37951046ef3e0556e4ccac2390afd9764.tar.gz |
mxfdec: Ignore the last entry in Avid's index table segments
The last entry is the total size of the essence container.
Previously a TemporalOffset error would be logged, even though segments like
these are expected.
Diffstat (limited to 'libavformat/mxfdec.c')
-rw-r--r-- | libavformat/mxfdec.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 3a0962429c..8a5c3c96ef 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -1072,11 +1072,16 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta for (i = x = 0; i < index_table->nb_segments; i++) { MXFIndexTableSegment *s = index_table->segments[i]; int index_delta = 1; + int n = s->nb_index_entries; - if (s->nb_index_entries == 2 * s->index_duration + 1) + if (s->nb_index_entries == 2 * s->index_duration + 1) { index_delta = 2; /* Avid index */ - for (j = 0; j < s->nb_index_entries; j += index_delta, x++) { + /* ignore the last entry - it's the size of the essence container */ + n--; + } + + for (j = 0; j < n; j += index_delta, x++) { int offset = s->temporal_offset_entries[j] / index_delta; int index = x + offset; |