[Ffmpeg-cvslog] r7531 - in trunk: libavcodec/dv.c libavformat/dvenc.c tests/libav.regression.ref

romansh subversion
Mon Jan 15 08:41:28 CET 2007


Author: romansh
Date: Mon Jan 15 08:41:28 2007
New Revision: 7531

Modified:
   trunk/libavcodec/dv.c
   trunk/libavformat/dvenc.c
   trunk/tests/libav.regression.ref

Log:
   * Fixing a bug with incorrect bits set in AAUX source pack
   * Making DV codec release a buffer on exit 
   * Flagging accepted pix_fmts for DV encoder



Modified: trunk/libavcodec/dv.c
==============================================================================
--- trunk/libavcodec/dv.c	(original)
+++ trunk/libavcodec/dv.c	Mon Jan 15 08:41:28 2007
@@ -1229,6 +1229,10 @@
 
 static int dvvideo_close(AVCodecContext *c)
 {
+    DVVideoContext *s = c->priv_data;
+
+    if(s->picture.data[0])
+        c->release_buffer(c, &s->picture);
 
     return 0;
 }
@@ -1242,10 +1246,7 @@
     sizeof(DVVideoContext),
     dvvideo_init,
     dvvideo_encode_frame,
-    dvvideo_close,
-    NULL,
-    CODEC_CAP_DR1,
-    NULL
+    .pix_fmts = (enum PixelFormat[]) {PIX_FMT_YUV411P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, -1},
 };
 #endif // CONFIG_DVVIDEO_ENCODER
 

Modified: trunk/libavformat/dvenc.c
==============================================================================
--- trunk/libavformat/dvenc.c	(original)
+++ trunk/libavformat/dvenc.c	Mon Jan 15 08:41:28 2007
@@ -28,6 +28,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <time.h>
+#include <stdarg.h>
 #include "avformat.h"
 #include "dvdata.h"
 #include "dv.h"
@@ -66,11 +67,12 @@
                                             sizeof(sys->audio_samples_dist[0]))];
 }
 
-static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* buf)
+static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* buf, ...)
 {
     struct tm tc;
     time_t ct;
     int ltc_frame;
+    va_list ap;
 
     buf[0] = (uint8_t)pack_id;
     switch (pack_id) {
@@ -99,7 +101,8 @@
                    (tc.tm_hour % 10);         /* Units of hours */
           break;
     case dv_audio_source:  /* AAUX source pack */
-          buf[1] = (0 << 7) | /* locked mode       */
+          va_start(ap, buf);
+          buf[1] = (1 << 7) | /* locked mode -- SMPTE only supports locked mode */
                    (1 << 6) | /* reserved -- always 1 */
                    (dv_audio_frame_size(c->sys, c->frames) -
                     c->sys->audio_min_samples[0]);
@@ -107,7 +110,7 @@
           buf[2] = (0 << 7) | /* multi-stereo      */
                    (0 << 5) | /* #of audio channels per block: 0 -- 1 channel */
                    (0 << 4) | /* pair bit: 0 -- one pair of channels */
-                    0;        /* audio mode        */
+                   !!va_arg(ap, int); /* audio mode        */
           buf[3] = (1 << 7) | /* res               */
                    (1 << 6) | /* multi-language flag */
                    (c->sys->dsf << 5) | /*  system: 60fields/50fields */
@@ -116,6 +119,7 @@
                    (0 << 6) | /* emphasis time constant: 0 -- reserved */
                    (0 << 3) | /* frequency: 0 -- 48Khz, 1 -- 44,1Khz, 2 -- 32Khz */
                     0;        /* quantization: 0 -- 16bit linear, 1 -- 12bit nonlinear */
+          va_end(ap);
           break;
     case dv_audio_control:
           buf[1] = (0 << 6) | /* copy protection: 0 -- unrestricted */
@@ -179,7 +183,7 @@
     for (i = 0; i < c->sys->difseg_size; i++) {
        frame_ptr += 6 * 80; /* skip DIF segment header */
        for (j = 0; j < 9; j++) {
-          dv_write_pack(dv_aaux_packs_dist[i][j], c, &frame_ptr[3]);
+          dv_write_pack(dv_aaux_packs_dist[i][j], c, &frame_ptr[3], i >= c->sys->difseg_size/2);
           for (d = 8; d < 80; d+=2) {
              of = c->sys->audio_shuffle[i][j] + (d - 8)/2 * c->sys->audio_stride;
              if (of*2 >= size)

Modified: trunk/tests/libav.regression.ref
==============================================================================
--- trunk/tests/libav.regression.ref	(original)
+++ trunk/tests/libav.regression.ref	Mon Jan 15 08:41:28 2007
@@ -25,7 +25,7 @@
 16518706f425cb537362bfc1c58b8de5 *./data/b-libav.mov
 366923 ./data/b-libav.mov
 ./data/b-libav.mov CRC=0x45079dca
-26c41db318d9aacfd6b9e734c0ea4d94 *./data/b-libav.dv
+064ffe6f670678b8f944df92560e1fff *./data/b-libav.dv
 3600000 ./data/b-libav.dv
 ./data/b-libav.dv CRC=0xa6b8b635
 2b3f921fb7a01bb126cab5ee21ae3f8d *./data/b-libav.gxf




More information about the ffmpeg-cvslog mailing list