From 31ff2cb266832a82ac4b5aaa2947719f47e4b425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Sat, 24 Mar 2012 17:13:55 +0100 Subject: [PATCH] DV: detect another case of broken DV files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See trac issue #217. Only the dsf field seems to be used to distinguish between PAL and NTSC. Signed-off-by: Reimar Döffinger --- libavcodec/dvdata.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/dvdata.c b/libavcodec/dvdata.c index ac639387f1..3dc3ae6785 100644 --- a/libavcodec/dvdata.c +++ b/libavcodec/dvdata.c @@ -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; }