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> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
		
							parent
							
								
									1fadf53e00
								
							
						
					
					
						commit
						fb8fa3c67c
					
				@ -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] == 64&& op[13] == 1) mxf->op = OPSonyOpt;
 | 
				
			||||||
    else if (op[12] == 0x10) {
 | 
					    else if (op[12] == 0x10) {
 | 
				
			||||||
        /* SMPTE 390m: "There shall be exactly one essence container"
 | 
					        /* SMPTE 390m: "There shall be exactly one essence container"
 | 
				
			||||||
         * 2011_DCPTEST_24FPS.V.mxf violates this and is frame wrapped,
 | 
					         * The following block deals with files that violate this, namely:
 | 
				
			||||||
         * which is why we assume OP1a. */
 | 
					         * 2011_DCPTEST_24FPS.V.mxf - two ECs, OP1a
 | 
				
			||||||
 | 
					         * abcdefghiv016f56415e.mxf - zero ECs, OPAtom, output by Avid AirSpeed */
 | 
				
			||||||
        if (nb_essence_containers != 1) {
 | 
					        if (nb_essence_containers != 1) {
 | 
				
			||||||
 | 
					            MXFOP op = nb_essence_containers ? OP1a : OPAtom;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            /* only nag once */
 | 
					            /* only nag once */
 | 
				
			||||||
            if (!mxf->op)
 | 
					            if (!mxf->op)
 | 
				
			||||||
                av_log(mxf->fc, AV_LOG_WARNING,
 | 
					                av_log(mxf->fc, AV_LOG_WARNING,
 | 
				
			||||||
                       "\"OPAtom\" with %u ECs - assuming OP1a\n",
 | 
					                       "\"OPAtom\" with %u ECs - assuming %s\n",
 | 
				
			||||||
                       nb_essence_containers);
 | 
					                       nb_essence_containers,
 | 
				
			||||||
 | 
					                       op == OP1a ? "OP1a" : "OPAtom");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            mxf->op = OP1a;
 | 
					            mxf->op = op;
 | 
				
			||||||
        } else
 | 
					        } else
 | 
				
			||||||
            mxf->op = OPAtom;
 | 
					            mxf->op = OPAtom;
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user