[FFmpeg-cvslog] mxfdec: fix Avid AirSpeed files being misinterpreted as OP1a

Tomas Härdin git at videolan.org
Tue Jul 10 21:35:46 CEST 2012


ffmpeg | branch: master | Tomas Härdin <tomas.hardin at codemill.se> | Fri Mar  2 11:33:28 2012 +0100| [fb8fa3c67c78d2218c578164b756cd000b0736d1] | committer: Luca Barbato

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 at gmx.at>
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fb8fa3c67c78d2218c578164b756cd000b0736d1
---

 libavformat/mxfdec.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index a0bbd7a..74a86a8 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -510,16 +510,20 @@ 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,
-         * which is 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);
+                       "\"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 {



More information about the ffmpeg-cvslog mailing list