[SCM] transcode/master: Update to libav 0.7 API

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Feb 12 19:05:42 UTC 2012


The following commit has been merged in the master branch:
commit d216029460cf987422cad7b009378530cb1a75a6
Author: Reinhard Tartler <siretart at tauware.de>
Date:   Sun Feb 12 19:46:55 2012 +0100

    Update to libav 0.7 API
    
    Fixes FTBFS

diff --git a/debian/patches/03_libav-api-fixes.diff b/debian/patches/03_libav-api-fixes.diff
new file mode 100644
index 0000000..3828cb9
--- /dev/null
+++ b/debian/patches/03_libav-api-fixes.diff
@@ -0,0 +1,94 @@
+Author: Reinhard Tartler <siretart at debian.org>
+Description: Update to libav 0.7 API
+Last-Modified: 2012-02-12
+
+diff --git a/export/export_ffmpeg.c b/export/export_ffmpeg.c
+index 847f633..2f4c94b 100644
+--- a/export/export_ffmpeg.c
++++ b/export/export_ffmpeg.c
+@@ -643,8 +643,10 @@ MOD_init
+ 
+     lavc_venc_context->bit_rate           = vob->divxbitrate * 1000;
+     lavc_venc_context->bit_rate_tolerance = lavc_param_vrate_tolerance * 1000;
++#ifdef FF_API_MB_Q
+     lavc_venc_context->mb_qmin            = lavc_param_mb_qmin;
+     lavc_venc_context->mb_qmax            = lavc_param_mb_qmax;
++#endif
+     lavc_venc_context->lmin= (int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5);
+     lavc_venc_context->lmax= (int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5);
+     lavc_venc_context->max_qdiff          = lavc_param_vqdiff;
+diff --git a/filter/filter_pp.c b/filter/filter_pp.c
+index 8790fd0..5b0a857 100644
+--- a/filter/filter_pp.c
++++ b/filter/filter_pp.c
+@@ -38,8 +38,8 @@
+ 
+ /* FIXME: these use the filter ID as an index--the ID can grow
+  * arbitrarily large, so this needs to be fixed */
+-static pp_mode_t *mode[100];
+-static pp_context_t *context[100];
++static pp_mode *mode[100];
++static pp_context *context[100];
+ static int width[100], height[100];
+ static int pre[100];
+ 
+diff --git a/import/decode_lavc.c b/import/decode_lavc.c
+index 2dea95d..48977e1 100644
+--- a/import/decode_lavc.c
++++ b/import/decode_lavc.c
+@@ -128,7 +128,7 @@ void decode_lavc(decode_t *decode)
+   char *mp4_ptr=NULL;
+   int flush = 0;
+   int mp4_size=0;
+-  int buf_len=0;
++  unsigned int buf_len=0;
+   int run=0;
+ 
+   // decoder
+@@ -186,7 +186,7 @@ void decode_lavc(decode_t *decode)
+   lavc_dec_context->error_concealment = 3;
+   lavc_dec_context->workaround_bugs = FF_BUG_AUTODETECT;
+ 
+-  if (avcodec_open(lavc_dec_context, lavc_dec_codec) < 0) {
++  if (avcodec_open2(lavc_dec_context, lavc_dec_codec, NULL) < 0) {
+       tc_log_error(__FILE__, "Could not initialize the '%s' codec.",
+ 		   codec->name);
+       goto decoder_error;
+@@ -261,8 +261,13 @@ void decode_lavc(decode_t *decode)
+ 
+       //tc_log_msg(__FILE__, "SIZE: (%d) MP4(%d) blen(%d) BUF(%d) read(%ld)", len, mp4_size, buf_len, READ_BUFFER_SIZE, bytes_read);
+       do {
+-	  len = avcodec_decode_video(lavc_dec_context, &picture,
+-		  &got_picture, buffer+buf_len, mp4_size-buf_len);
++          AVPacket avpkt;
++          av_init_packet(&avpkt);
++          avpkt.data = (uint8_t*) buffer+buf_len;
++          avpkt.size = mp4_size-buf_len;
++
++	  len = avcodec_decode_video2(lavc_dec_context, &picture,
++		  &got_picture, &avpkt);
+ 
+ 	  if (len < 0) {
+ 	      tc_log_error(__FILE__, "frame decoding failed");
+diff --git a/import/probe_ffmpeg.c b/import/probe_ffmpeg.c
+index 2b7486b..89e4a50 100644
+--- a/import/probe_ffmpeg.c
++++ b/import/probe_ffmpeg.c
+@@ -47,7 +47,7 @@ static void translate_info(const AVFormatContext *ctx, ProbeInfo *info)
+     for (i = 0; i < ctx->nb_streams; i++) {
+         st = ctx->streams[i];
+ 
+-        if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
++        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+             info->bitrate = st->codec->bit_rate / 1000;
+             info->width = st->codec->width;
+             info->height = st->codec->height;
+@@ -65,7 +65,7 @@ static void translate_info(const AVFormatContext *ctx, ProbeInfo *info)
+     for (i = 0; i < ctx->nb_streams; i++) {
+         st = ctx->streams[i];
+ 
+-        if (st->codec->codec_type == CODEC_TYPE_AUDIO
++        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO
+          && j < TC_MAX_AUD_TRACKS) {
+             info->track[j].format = 0x1; /* known wrong */
+             info->track[j].chan = st->codec->channels;
diff --git a/debian/patches/series b/debian/patches/series
index 6cb5fd6..e2b6439 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 01_filter_pv.c.diff
 02_toolame.diff
+03_libav-api-fixes.diff

-- 
transcode packaging



More information about the pkg-multimedia-commits mailing list