aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Härdin <tomas.hardin@codemill.se>2012-03-02 11:33:28 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-08 00:39:56 +0100
commit8c7721e7094c6d2a9079e26be135d673becaddaa (patch)
tree2fac3f6a54388628b6487bfbc8827a8ec3ad4d06
parentbf2290a80c124c5168f78be64ee87d9efdd4040d (diff)
downloadffmpeg-8c7721e7094c6d2a9079e26be135d673becaddaa.tar.gz
mxfdec: Fix Avid AirSpeed files being misinterpreted as OP1a
The "ECs != 1 -> OP1a" assumption was wrong. Luckily, the file that triggered that behavior had two ECs, not zero. Hence distinguishing between them is simple in this case. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mxfdec.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index ff1e8ec40b..b9c9034dc4 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -510,13 +510,18 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size
else if (op[12] == 64&& op[13] == 1) mxf->op = OPSONYOpt;
else if (op[12] == 0x10) {
/* SMPTE 390m: "There shall be exactly one essence container"
- * 2011_DCPTEST_24FPS.V.mxf violates this and is frame wrapped, hence why we assume OP1a */
+ * The following block deals with files that violate this, namely:
+ * 2011_DCPTEST_24FPS.V.mxf - two ECs, OP1a
+ * abcdefghiv016f56415e.mxf - zero ECs, OPAtom, output by Avid AirSpeed */
if (nb_essence_containers != 1) {
+ MXFOP op = nb_essence_containers ? OP1a : OPAtom;
+
/* only nag once */
if (!mxf->op)
- av_log(mxf->fc, AV_LOG_WARNING, "\"OPAtom\" with %u ECs - assuming OP1a\n", nb_essence_containers);
+ av_log(mxf->fc, AV_LOG_WARNING, "\"OPAtom\" with %u ECs - assuming %s\n",
+ nb_essence_containers, op == OP1a ? "OP1a" : "OPAtom");
- mxf->op = OP1a;
+ mxf->op = op;
} else
mxf->op = OPAtom;
} else {