summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Härdin <tomas.hardin@codemill.se>2012-01-26 13:21:30 +0100
committerDiego Biurrun <diego@biurrun.de>2012-02-09 13:26:02 +0100
commite24167aae6c6ce2839537356077faac5602694bc (patch)
tree7e2eb8fe330bc49d587b75ba9c48406616f6d208
parentd6b81ff949af13969ac2ae4cdf5852a6d09c267f (diff)
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. Signed-off-by: Diego Biurrun <diego@biurrun.de>
-rw-r--r--libavformat/mxfdec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 50c40c9182..dd102408db 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1131,11 +1131,15 @@ 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 */
+ /* ignore the last entry - it's the size of the essence container */
+ n--;
+ }
- for (j = 0; j < s->nb_index_entries; j += index_delta, x++) {
+ for (j = 0; j < n; j += index_delta, x++) {
int offset = s->temporal_offset_entries[j] / index_delta;
int index = x + offset;