changeset 5351:6b4caae00305 libavcodec

* making profile selection a bit more tolerant to the badly broken streams
author romansh
date Tue, 17 Jul 2007 04:06:03 +0000
parents 503498b93901
children 4cd6e59c64eb
files dvdata.h
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dvdata.h	Tue Jul 17 00:36:47 2007 +0000
+++ b/dvdata.h	Tue Jul 17 04:06:03 2007 +0000
@@ -2665,14 +2665,14 @@
 {
     if ((frame[3] & 0x80) == 0) {      /* DSF flag */
         /* it's an NTSC format */
-        if ((frame[80*5 + 48 + 3] & 0x4)) { /* 4:2:2 sampling */
+        if ((frame[80*5 + 48 + 3] & 0x4) && (frame[80*5 + 48] == dv_video_source)) { /* 4:2:2 sampling */
             return &dv_profiles[3]; /* NTSC 50Mbps */
         } else { /* 4:1:1 sampling */
             return &dv_profiles[0]; /* NTSC 25Mbps */
         }
     } else {
         /* it's a PAL format */
-        if ((frame[80*5 + 48 + 3] & 0x4)) { /* 4:2:2 sampling */
+        if ((frame[80*5 + 48 + 3] & 0x4) && (frame[80*5 + 48] == dv_video_source)) { /* 4:2:2 sampling */
             return &dv_profiles[4]; /* PAL 50Mbps */
         } else if ((frame[5] & 0x07) == 0) { /* APT flag */
             return &dv_profiles[1]; /* PAL 25Mbps 4:2:0 */