diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-19 20:46:08 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-19 20:46:52 +0100 |
commit | 8263c1469164392c9b2946bf11d58d9a921829cf (patch) | |
tree | bc11d38e84c9fc9aefb3826e93b16026ec76900b /libavformat/mxfdec.c | |
parent | bd9e0127c9fbfc18f1a663483d9388d69a1581f6 (diff) | |
parent | 842ea36c747eb6537c4236114346cb7a3e9a8df1 (diff) |
Merge commit '842ea36c747eb6537c4236114346cb7a3e9a8df1'
* commit '842ea36c747eb6537c4236114346cb7a3e9a8df1':
mxf: Override faulty PreviousPartition entries
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mxfdec.c')
-rw-r--r-- | libavformat/mxfdec.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index c08a796844..7e8097864b 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -495,6 +495,26 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size } nb_essence_containers = avio_rb32(pb); + if (partition->this_partition && + partition->previous_partition == partition->this_partition) { + av_log(mxf->fc, AV_LOG_ERROR, + "PreviousPartition equal to ThisPartition %"PRIx64"\n", + partition->previous_partition); + /* override with the actual previous partition offset */ + if (!mxf->parsing_backward && mxf->last_forward_partition > 1) { + MXFPartition *prev = + mxf->partitions + mxf->last_forward_partition - 2; + partition->previous_partition = prev->this_partition; + } + /* if no previous body partition are found point to the header + * partition */ + if (partition->previous_partition == partition->this_partition); + partition->previous_partition = 0; + av_log(mxf->fc, AV_LOG_ERROR, + "Overriding PreviousPartition with %"PRIx64"\n", + partition->previous_partition); + } + /* some files don'thave FooterPartition set in every partition */ if (footer_partition) { if (mxf->footer_partition && mxf->footer_partition != footer_partition) { |