DV: detect another case of broken DV files.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sat, 24 Mar 2012 16:13:55 +0000 (17:13 +0100)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sun, 25 Mar 2012 10:23:44 +0000 (12:23 +0200)
See trac issue #217.
Only the dsf field seems to be used to distinguish between PAL and NTSC.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
libavcodec/dvdata.c

index ac63938..3dc3ae6 100644 (file)
@@ -311,6 +311,10 @@ const DVprofile* avpriv_dv_frame_profile2(AVCodecContext* codec, const DVprofile
     if (sys && buf_size == sys->frame_size)
         return sys;
 
+    /* hack for trac issue #217, dv files created with QuickTime 3 */
+    if ((frame[3] & 0x7f) == 0x3f && frame[80 * 5 + 48 + 3] == 0xff)
+        return &dv_profiles[dsf];
+
     return NULL;
 }