[SCM] gmerlin-avdecoder/master: Add patch to fix compilation with libav 0.7 (Closes: #638564, LP: #831276), thanks to Colin Watson for the patch.

alessio at users.alioth.debian.org alessio at users.alioth.debian.org
Tue Aug 30 07:56:47 UTC 2011


The following commit has been merged in the master branch:
commit 5f9e9102ee4f8a834f16b73a4ff0be91d1303367
Author: Alessio Treglia <alessio at debian.org>
Date:   Tue Aug 30 09:55:01 2011 +0200

    Add patch to fix compilation with libav 0.7 (Closes: #638564, LP: #831276), thanks to Colin Watson for the patch.

diff --git a/debian/patches/libav_0.7.patch b/debian/patches/libav_0.7.patch
new file mode 100644
index 0000000..5f3e964
--- /dev/null
+++ b/debian/patches/libav_0.7.patch
@@ -0,0 +1,202 @@
+Description: Fix compilation with new libav 0.7.
+Author: Colin Watson <cjwatson at ubuntu.com>
+Bug-Ubuntu: https://launchpad.net/bugs/831276
+Bug-Debian: http://bugs.debian.org/638564
+Forwarded: no
+---
+ lib/demux_ffmpeg.c |   73 +++++++++++++++++++++++++++++++++++++++++++++++------
+ lib/video_ffmpeg.c |   15 ++++++++--
+ 2 files changed, 77 insertions(+), 11 deletions(-)
+
+--- gmerlin-avdecoder.orig/lib/demux_ffmpeg.c
++++ gmerlin-avdecoder/lib/demux_ffmpeg.c
+@@ -29,6 +29,29 @@
+ 
+ #define PROBE_SIZE 2048 /* Same as in MPlayer */
+ 
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 30, 2)
++#define AV_PKT_FLAG_KEY PKT_FLAG_KEY
++#endif
++
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 64, 0)
++#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
++#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
++#define AVMEDIA_TYPE_SUBTITLE CODEC_TYPE_SUBTITLE
++#endif
++
++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 102, 0)
++#define AVIOContext ByteIOContext
++#endif
++
++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 105, 0)
++#define avio_open url_fopen
++#endif
++
++#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(51, 5, 0)
++#define AVDictionaryEntry AVMetadataTag
++#define av_dict_get av_metadata_get
++#endif
++
+ static void cleanup_stream_ffmpeg(bgav_stream_t * s)
+   {
+   if(s->type == BGAV_STREAM_VIDEO)
+@@ -45,7 +68,7 @@ typedef struct
+ #if LIBAVFORMAT_VERSION_INT < ((52<<16)+(0<<8)+0)
+   ByteIOContext pb;
+ #else
+-  ByteIOContext * pb;
++  AVIOContext * pb;
+ #endif
+   } ffmpeg_priv_t;
+ 
+@@ -572,9 +595,16 @@ static int open_ffmpeg(bgav_demuxer_cont
+   int i;
+   ffmpeg_priv_t * priv;
+   AVFormatContext *avfc;
++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 2, 0)
+   AVFormatParameters ap;
++#endif
+   char * tmp_filename;
++#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52, 31, 0)
++  AVDictionaryEntry *entry;
++#endif
++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 2, 0)
+   memset(&ap, 0, sizeof(ap));
++#endif
+   priv = calloc(1, sizeof(*priv));
+   ctx->priv = priv;
+ 
+@@ -582,8 +612,10 @@ static int open_ffmpeg(bgav_demuxer_cont
+      called multiple times */
+ #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 29, 0)
+   register_protocol(&bgav_protocol);
+-#else
++#elif LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 69, 0)
+   av_register_protocol(&bgav_protocol);
++#else
++  av_register_protocol2(&bgav_protocol, sizeof(bgav_protocol));
+ #endif
+   
+ #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 26, 0)
+@@ -594,7 +626,7 @@ static int open_ffmpeg(bgav_demuxer_cont
+   
+   tmp_filename = bgav_sprintf("bgav:%s", ctx->input->filename);
+ 
+-  url_fopen(&priv->pb, tmp_filename, URL_RDONLY);
++  avio_open(&priv->pb, tmp_filename, URL_RDONLY);
+ #if LIBAVFORMAT_VERSION_INT < ((52<<16)+(0<<8)+0)
+   ((URLContext*)(priv->pb.opaque))->priv_data= ctx->input;
+ #else
+@@ -604,8 +636,11 @@ static int open_ffmpeg(bgav_demuxer_cont
+   
+ #if LIBAVFORMAT_VERSION_INT < ((52<<16)+(0<<8)+0)
+   if(av_open_input_stream(&avfc, &priv->pb, tmp_filename, priv->avif, &ap)<0)
+-#else
++#elif LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 2, 0)
+   if(av_open_input_stream(&avfc, priv->pb, tmp_filename, priv->avif, &ap)<0)
++#else
++  avfc->pb = priv->pb;
++  if(avformat_open_input(&avfc, tmp_filename, priv->avif, NULL)<0)
+ #endif
+     {
+     bgav_log(ctx->opt,BGAV_LOG_ERROR,LOG_DOMAIN,
+@@ -629,13 +664,13 @@ static int open_ffmpeg(bgav_demuxer_cont
+     {
+     switch(avfc->streams[i]->codec->codec_type)
+       {
+-      case CODEC_TYPE_AUDIO:
++      case AVMEDIA_TYPE_AUDIO:
+         init_audio_stream(ctx, avfc->streams[i], i);
+         break;
+-      case CODEC_TYPE_VIDEO:
++      case AVMEDIA_TYPE_VIDEO:
+         init_video_stream(ctx, avfc->streams[i], i);
+         break;
+-      case CODEC_TYPE_SUBTITLE:
++      case AVMEDIA_TYPE_SUBTITLE:
+         break;
+       default:
+         break;
+@@ -654,6 +689,7 @@ static int open_ffmpeg(bgav_demuxer_cont
+                                          priv->avfc->iformat->long_name);
+ 
+   /* Metadata */
++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 31, 0)
+   if(avfc->title[0])
+     ctx->tt->cur->metadata.title = bgav_strdup(avfc->title);
+   if(avfc->author[0])
+@@ -664,6 +700,27 @@ static int open_ffmpeg(bgav_demuxer_cont
+     ctx->tt->cur->metadata.album = bgav_strdup(avfc->album);
+   if(avfc->genre[0])
+     ctx->tt->cur->metadata.genre = bgav_strdup(avfc->genre);
++#else
++  entry = av_dict_get(avfc->metadata, "title", NULL, 0);
++  if (entry->value[0])
++    ctx->tt->cur->metadata.title = bgav_strdup(entry->value);
++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 50, 0)
++  entry = av_dict_get(avfc->metadata, "author", NULL, 0);
++#else
++  entry = av_dict_get(avfc->metadata, "artist", NULL, 0);
++#endif
++  if (entry->value[0])
++    ctx->tt->cur->metadata.author = bgav_strdup(entry->value);
++  entry = av_dict_get(avfc->metadata, "copyright", NULL, 0);
++  if (entry->value[0])
++    ctx->tt->cur->metadata.copyright = bgav_strdup(entry->value);
++  entry = av_dict_get(avfc->metadata, "album", NULL, 0);
++  if (entry->value[0])
++    ctx->tt->cur->metadata.album = bgav_strdup(entry->value);
++  entry = av_dict_get(avfc->metadata, "genre", NULL, 0);
++  if (entry->value[0])
++    ctx->tt->cur->metadata.genre = bgav_strdup(entry->value);
++#endif
+   
+   return 1;
+   }
+@@ -739,7 +796,7 @@ static int next_packet_ffmpeg(bgav_demux
+     s->data.video.palette_changed = 1;
+     }
+   
+-  if(pkt.flags&PKT_FLAG_KEY)
++  if(pkt.flags&AV_PKT_FLAG_KEY)
+     PACKET_SET_KEYFRAME(p);
+   bgav_stream_done_packet_write(s, p);
+   
+--- gmerlin-avdecoder.orig/lib/video_ffmpeg.c
++++ gmerlin-avdecoder/lib/video_ffmpeg.c
+@@ -64,6 +64,15 @@
+ 
+ #define HAS_DELAY      (1<<0)
+ 
++#if LIBPOSTPROC_VERSION_MAJOR < 52
++#define pp_context pp_context_t
++#define pp_mode pp_mode_t
++#endif
++
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 64, 0)
++#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
++#endif
++
+ static int get_format_jpeg(bgav_stream_t*, bgav_packet_t * p);
+ static int get_format_dv(bgav_stream_t*, bgav_packet_t * p);
+ 
+@@ -116,8 +125,8 @@ typedef struct
+ 
+ #ifdef HAVE_LIBPOSTPROC
+   int do_pp;
+-  pp_context_t *pp_context;
+-  pp_mode_t    *pp_mode;
++  pp_context *pp_context;
++  pp_mode    *pp_mode;
+ #endif
+ 
+ #ifdef HAVE_LIBSWSCALE
+@@ -836,7 +845,7 @@ static int init_ffmpeg(bgav_stream_t * s
+   if(s->action == BGAV_STREAM_PARSE)
+     return 1;
+   
+-  priv->ctx->codec_type = CODEC_TYPE_VIDEO;
++  priv->ctx->codec_type = AVMEDIA_TYPE_VIDEO;
+   
+   priv->ctx->bit_rate = 0;
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 39f10e7..f554f54 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ fix_dvdread_configure.patch
 autoconf_removed_sources.patch
 system_gsm.patch
 fix_typos.patch
+libav_0.7.patch

-- 
gmerlin-avdecoder packaging



More information about the pkg-multimedia-commits mailing list