]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dvdata.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavcodec / dvdata.c
index 9de1db527081917f422bd45e1d453e20d558eaf7..6a29a59e5e2ad4d3a31a79bf734f3eafc368a175 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "libavutil/rational.h"
 #include "libavutil/intreadwrite.h"
+#include "libavutil/pixdesc.h"
 #include "avcodec.h"
 #include "dvdata.h"
 
@@ -300,7 +301,7 @@ const DVprofile* avpriv_dv_frame_profile2(AVCodecContext* codec, const DVprofile
         return &dv_profiles[2];
     }
 
-    if(stype == 0 && codec && codec->codec_tag==AV_RL32("dvsd") && codec->width==720 && codec->height==576)
+    if(stype == 0 && codec && codec->codec_tag==AV_RL32("dvsd") && codec->coded_width==720 && codec->coded_height==576)
         return &dv_profiles[1];
 
     for (i = 0; i < FF_ARRAY_ELEMS(dv_profiles); i++)
@@ -311,6 +312,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;
 }
 
@@ -341,3 +346,14 @@ const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec)
 
     return NULL;
 }
+
+void ff_dv_print_profiles(void *logctx, int loglevel)
+{
+    int i;
+    for (i = 0; i < FF_ARRAY_ELEMS(dv_profiles); i++) {
+        const DVprofile *p = &dv_profiles[i];
+        av_log(logctx, loglevel, "Frame size: %dx%d; pixel format: %s, "
+               "framerate: %d/%d\n", p->width, p->height, av_get_pix_fmt_name(p->pix_fmt),
+               p->time_base.den, p->time_base.num);
+    }
+}