]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dvdata.h
Use reget_buffer instead of get_buffer. Fixes issue1367.
[ffmpeg] / libavcodec / dvdata.h
index f53fbea28325607a9a0e312fb5ec570a263742d0..a32b863c5d73890ff4692d2b89056c7c100f6d05 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Constants for DV codec
- * Copyright (c) 2002 Fabrice Bellard.
+ * Copyright (c) 2002 Fabrice Bellard
  *
  * This file is part of FFmpeg.
  *
@@ -20,7 +20,7 @@
  */
 
 /**
- * @file dvdata.h
+ * @file libavcodec/dvdata.h
  * Constants for DV codec.
  */
 
@@ -651,9 +651,9 @@ static const DVprofile dv_profiles[] = {
       .bpm = 8,
       .block_sizes = block_sizes_dv100,
       .audio_stride = 90,
-      .audio_min_samples  = { 1580, 1452, 1053 }, /* for 48, 44.1 and 32kHz */
-      .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 }, /* per SMPTE-314M */
-      .audio_shuffle = dv_audio_shuffle525,
+      .audio_min_samples  = { 1896, 1742, 1264 }, /* for 48, 44.1 and 32kHz */
+      .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
+      .audio_shuffle = dv_audio_shuffle625,
     }
 };
 
@@ -698,7 +698,9 @@ enum dv_pack_type {
  */
 #define DV_MAX_BPM 8
 
-static inline const DVprofile* dv_frame_profile(const uint8_t* frame)
+static inline
+const DVprofile* dv_frame_profile(const DVprofile *sys,
+                                  const uint8_t* frame, unsigned buf_size)
 {
    int i;
 
@@ -715,6 +717,10 @@ static inline const DVprofile* dv_frame_profile(const uint8_t* frame)
        if (dsf == dv_profiles[i].dsf && stype == dv_profiles[i].video_stype)
            return &dv_profiles[i];
 
+   /* check if old sys matches and assumes corrupted input */
+   if (sys && buf_size == sys->frame_size)
+       return sys;
+
    return NULL;
 }