Fix build with newer versions of libav (bug #376419).
authorTim Harder <radhermit@gentoo.org>
Mon, 12 Sep 2011 06:02:38 +0000 (06:02 +0000)
committerTim Harder <radhermit@gentoo.org>
Mon, 12 Sep 2011 06:02:38 +0000 (06:02 +0000)
Package-Manager: portage-2.2.0_alpha55/cvs/Linux x86_64

media-libs/xine-lib/ChangeLog
media-libs/xine-lib/Manifest
media-libs/xine-lib/files/xine-lib-1.1.19-ffmpeg.patch

index 357de0d54906dd6ed20f028cf4bf6722aa5eaa49..e76aec517cc7ed57bad3f85578038d2b2bd2b37a 100644 (file)
@@ -1,6 +1,10 @@
 # ChangeLog for media-libs/xine-lib
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/xine-lib/ChangeLog,v 1.643 2011/05/11 19:11:38 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-libs/xine-lib/ChangeLog,v 1.644 2011/09/12 06:02:38 radhermit Exp $
+
+  12 Sep 2011; Tim Harder <radhermit@gentoo.org>
+  files/xine-lib-1.1.19-ffmpeg.patch:
+  Fix build with newer versions of libav (bug #376419).
 
   11 May 2011; Alexis Ballier <aballier@gentoo.org> xine-lib-1.1.19.ebuild,
   +files/xine-lib-1.1.19-ffmpeg.patch:
index a43f35442ebb5a54bf5db9c43f15112377188cd1..46b65301724c5f8991b1298ff4fa5f028888c6a1 100644 (file)
@@ -1,17 +1,21 @@
 -----BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
+Hash: SHA512
 
-AUX xine-lib-1.1.19-ffmpeg.patch 4521 RMD160 6c7f8f6708f0c230f809a80de76cb0b63dc86659 SHA1 de8d432d3472abd0409934a7c194140096310018 SHA256 4b24e0144bfd34ee37bc4493bbb0f5fd06b3097a92cccd8175b22581d8041937
+AUX xine-lib-1.1.19-ffmpeg.patch 12127 RMD160 2b70139da2f4832e3577a667c352257dcd610dcf SHA1 d70f14c3dbb59b65c581575fa1fe13aeeb38f1b1 SHA256 6ca05a1fbed6eeee19e822da2d789831c3f2593cb0d430385416ae170bc3c48f
 AUX xine-lib-1.1.19-xvmc.patch 485 RMD160 781a7fbc5dcc9f3c25de83625509fcce3950cca8 SHA1 f78834833e3aeb05f555688ab657ae05cd0691c7 SHA256 6be3ceb8edd7626e93c617de3068374dd638e1445c7308d88b24614e9bbceaf0
 DIST xine-lib-1.1.15-textrel-fix.patch 29373 RMD160 4702a26f42251614f5f6c99b4770f82da36577ae SHA1 e04d04dbd736fd17be8cf0583d47630850a89bf9 SHA256 1d6aa047cb0a13f248aea2e06e16b9758b9c39d8b7e42b32d0b52b424d26b33e
 DIST xine-lib-1.1.19.tar.xz 5782580 RMD160 7b8c2a4e5bcd0984414360d8d589aa533a9040f3 SHA1 f65f762d2e16adf04b9d715c91ee0bc02c322a7d SHA256 f834f646880bb44186018d12280ac27c8314447de9335b6fe390157b26df9cd9
 EBUILD xine-lib-1.1.19.ebuild 5641 RMD160 01bf8a074e16571e2d63161b027df2c2c684818c SHA1 2153e0d9742a21ee417fe7e2028fd633cba93149 SHA256 4427df891249014998a51905c1ed7de19ec76a664eb2af7d73a48e9604cd0a5b
-MISC ChangeLog 74733 RMD160 4d0d520272e87c8a61195cf3c545c97f5ffa51f2 SHA1 264314a061b936bf577dffe77752509ac730a871 SHA256 52b0d10e55a4f41d0ef0a6e397d640092ca2b0441b5fde7b2beae03594b01c61
+MISC ChangeLog 74878 RMD160 9b320a8257a48efa9b6faeef508971dc25cf50d3 SHA1 8df5b1812787ce84f25f47ba4bacdcf111502488 SHA256 7917579c8d1151ebfcf76b53a33e278d242143a117e1d820483c5e70b3aa7abc
 MISC metadata.xml 2913 RMD160 ea5722272700444f2ffe366feb88dfd0a18636df SHA1 97d2d10cc63bde0a4bfc46b9b8c4474ee0337b45 SHA256 4929566b88860ef0c53c15ed84ce5d8bbd36692461631fd3d4814dc9bc0807cf
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.17 (GNU/Linux)
+Version: GnuPG v2.0.18 (GNU/Linux)
 
-iEYEARECAAYFAk3K33AACgkQvFcC4BYPU0q88QCfaHIsgaxO928t1tqc4/V6lT69
-1UEAoJCmbUA+WKrA2JzDrIu1Mgou7p3G
-=QA+J
+iQEcBAEBCgAGBQJObaCNAAoJEEqz6FtPBkyj1S4H+wVy5azCdgS5o/MgMD6aeYkV
+AeFWfH5IfEkpFgh0xiHbREN9Zd832Bg0+ocorOsnNmfOMUtq5YaQ6ks8VCebf3ZZ
+aX648NdDEnptOYadZb8RPxkt1TR/nVZE3CpB+6bus/K3j/ZTLL4qQJ/OulRGOOz4
+/ToKn0cfmkxXko6LCiB59kVfkmVfE5ASOm5hipLK8o7RDZeYOC+Tzw39KcjX9/gb
++OQO0xXPczAzmhS13LFVzrn2VbeNMtsP5DMk5Kr3hnaQ7YA32iCF3RVRVeKaoMAd
+6QValbdK8ytZWum7xkh/gThhqBbINIEiEjSmnBNQVafGXG2UZJcNxZUMz1ut7ag=
+=I7NC
 -----END PGP SIGNATURE-----
index 5d05a9c0871f30cf3556c1d1b3d8d6f653aece5b..6817aa9894602718e0e51e67847b973dc2e1a811 100644 (file)
-Index: xine-lib-1.1.19/src/combined/ffmpeg/ff_audio_decoder.c
-===================================================================
---- xine-lib-1.1.19.orig/src/combined/ffmpeg/ff_audio_decoder.c
-+++ xine-lib-1.1.19/src/combined/ffmpeg/ff_audio_decoder.c
-@@ -285,12 +285,15 @@ static void ff_audio_decode_data (audio_
+diff -r 717450d734f7 src/combined/ffmpeg/ff_audio_decoder.c
+--- a/src/combined/ffmpeg/ff_audio_decoder.c   Mon May 16 15:49:02 2011 +0100
++++ b/src/combined/ffmpeg/ff_audio_decoder.c   Mon May 16 19:46:49 2011 -0400
+@@ -46,6 +46,12 @@
  
+ #define AUDIOBUFSIZE (64 * 1024)
++#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 32)
++#  define AVAUDIO 3
++#else
++#  define AVAUDIO 2
++#endif
++
+ typedef struct {
+   audio_decoder_class_t   decoder_class;
+ } ff_audio_class_t;
+@@ -255,6 +261,9 @@
+       buf->decoder_info[2]);
+   } else if (!(buf->decoder_flags & BUF_FLAG_SPECIAL)) {
++#if AVAUDIO > 2
++    AVPacket avpkt;
++#endif
+     if( !this->decoder_ok ) {
+       if ( ! this->context || ! this->codec ) {
+@@ -286,11 +295,21 @@
      if (!this->output_open) {
        if (!this->audio_bits || !this->audio_sample_rate || !this->audio_channels) {
-+        AVPacket pkt;
          decode_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
--        avcodec_decode_audio2 (this->context,
-+      av_init_packet( &pkt );
-+      pkt.data = &this->buf[0];
-+      pkt.size = this->size;
-+        avcodec_decode_audio3 (this->context,
++#if AVAUDIO > 2
++      av_init_packet (&avpkt);
++      avpkt.data = (uint8_t *)&this->buf[0];
++      avpkt.size = this->size;
++      avpkt.flags = AV_PKT_FLAG_KEY;
++      avcodec_decode_audio3 (this->context,
++                             (int16_t *)this->decode_buffer,
++                             &decode_buffer_size, &avpkt);
++#else
+         avcodec_decode_audio2 (this->context,
                                (int16_t *)this->decode_buffer,
                                &decode_buffer_size,
--                              &this->buf[0],
--                              this->size);
-+                            &pkt);
+                               &this->buf[0],
+                               this->size);
++#endif
        this->audio_bits = this->context->bits_per_sample;
        this->audio_sample_rate = this->context->sample_rate;
        this->audio_channels = this->context->channels;
-@@ -310,12 +313,15 @@ static void ff_audio_decode_data (audio_
+@@ -311,12 +330,21 @@
        offset = 0;
        while (this->size>0) {
-+        AVPacket pkt;
          decode_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
--        bytes_consumed = avcodec_decode_audio2 (this->context,
-+      av_init_packet( &pkt );
-+      pkt.data = &this->buf[offset];
-+      pkt.size = this->size;
-+        bytes_consumed = avcodec_decode_audio3 (this->context,
++#if AVAUDIO > 2
++      av_init_packet (&avpkt);
++      avpkt.data = (uint8_t *)&this->buf[offset];
++      avpkt.size = this->size;
++      avpkt.flags = AV_PKT_FLAG_KEY;
++      bytes_consumed = avcodec_decode_audio3 (this->context,
++                                              (int16_t *)this->decode_buffer,
++                                              &decode_buffer_size, &avpkt);
++#else
+         bytes_consumed = avcodec_decode_audio2 (this->context,
                                                 (int16_t *)this->decode_buffer,
                                                 &decode_buffer_size,
--                                               &this->buf[offset],
--                                               this->size);
-+                                             &pkt);
+                                                &this->buf[offset],
+                                                this->size);
+-
++#endif
          if (bytes_consumed<0) {
            xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
-Index: xine-lib-1.1.19/src/combined/ffmpeg/ff_video_decoder.c
-===================================================================
---- xine-lib-1.1.19.orig/src/combined/ffmpeg/ff_video_decoder.c
-+++ xine-lib-1.1.19/src/combined/ffmpeg/ff_video_decoder.c
-@@ -1026,6 +1026,7 @@ static void ff_handle_mpeg12_buffer (ff_
-     uint8_t *current;
-     int next_flush;
-+    AVPacket pkt;
-     got_picture = 0;
-     if (!flush) {
-@@ -1055,12 +1056,14 @@ static void ff_handle_mpeg12_buffer (ff_
+                    "ffmpeg_audio_dec: error decompressing audio frame\n");
+diff -r 717450d734f7 src/combined/ffmpeg/ff_video_decoder.c
+--- a/src/combined/ffmpeg/ff_video_decoder.c   Mon May 16 15:49:02 2011 +0100
++++ b/src/combined/ffmpeg/ff_video_decoder.c   Mon May 16 19:46:49 2011 -0400
+@@ -58,6 +58,14 @@
+ #define ENABLE_DIRECT_RENDERING
++#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 32)
++#  define AVVIDEO 2
++#else
++#  define AVVIDEO 1
++#  define pp_context  pp_context_t
++#  define pp_mode     pp_mode_t
++#endif
++
+ /* reordered_opaque appeared in libavcodec 51.68.0 */
+ #define AVCODEC_HAS_REORDERED_OPAQUE
+ #if LIBAVCODEC_VERSION_INT < 0x334400
+@@ -116,8 +124,8 @@
+   int               pp_quality;
+   int               pp_flags;
+-  pp_context_t     *pp_context;
+-  pp_mode_t        *pp_mode;
++  pp_context       *our_context;
++  pp_mode          *our_mode;
+   /* mpeg-es parsing */
+   mpeg_parser_t    *mpeg_parser;
+@@ -444,23 +452,23 @@
+   this->pp_quality = this->class->pp_quality;
+   if(this->pp_available && this->pp_quality) {
+-    if(!this->pp_context && this->context)
+-      this->pp_context = pp_get_context(this->context->width, this->context->height,
++    if(!this->our_context && this->context)
++      this->our_context = pp_get_context(this->context->width, this->context->height,
+                                         this->pp_flags);
+-    if(this->pp_mode)
+-      pp_free_mode(this->pp_mode);
++    if(this->our_mode)
++      pp_free_mode(this->our_mode);
+-    this->pp_mode = pp_get_mode_by_name_and_quality("hb:a,vb:a,dr:a",
++    this->our_mode = pp_get_mode_by_name_and_quality("hb:a,vb:a,dr:a",
+                                                     this->pp_quality);
+   } else {
+-    if(this->pp_mode) {
+-      pp_free_mode(this->pp_mode);
+-      this->pp_mode = NULL;
++    if(this->our_mode) {
++      pp_free_mode(this->our_mode);
++      this->our_mode = NULL;
+     }
+-    if(this->pp_context) {
+-      pp_free_context(this->pp_context);
+-      this->pp_context = NULL;
++    if(this->our_context) {
++      pp_free_context(this->our_context);
++      this->our_context = NULL;
+     }
+   }
+ }
+@@ -1055,12 +1063,26 @@
      }
  
      /* skip decoding b frames if too late */
--    this->context->hurry_up = (this->skipframes > 0);
-+    this->context->skip_frame = (this->skipframes > 0? AVDISCARD_NONREF : AVDISCARD_DEFAULT);
++#if AVVIDEO > 1
++    this->context->skip_frame = (this->skipframes > 0) ? AVDISCARD_NONREF : AVDISCARD_DEFAULT;
++#else
+     this->context->hurry_up = (this->skipframes > 0);
++#endif
  
-+    av_init_packet( &pkt );
-+    pkt.data = this->mpeg_parser->chunk_buffer;
-+    pkt.size = this->mpeg_parser->buffer_size;
      lprintf("avcodec_decode_video: size=%d\n", this->mpeg_parser->buffer_size);
--    len = avcodec_decode_video (this->context, this->av_frame,
--                                &got_picture, this->mpeg_parser->chunk_buffer,
--                                this->mpeg_parser->buffer_size);
++#if AVVIDEO > 1
++    AVPacket avpkt;
++    av_init_packet(&avpkt);
++    avpkt.data = (uint8_t *)this->mpeg_parser->chunk_buffer;
++    avpkt.size = this->mpeg_parser->buffer_size;
++    avpkt.flags = AV_PKT_FLAG_KEY;
 +    len = avcodec_decode_video2 (this->context, this->av_frame,
-+                                &got_picture, &pkt);
++                               &got_picture, &avpkt);
++#else
+     len = avcodec_decode_video (this->context, this->av_frame,
+                                 &got_picture, this->mpeg_parser->chunk_buffer,
+                                 this->mpeg_parser->buffer_size);
++#endif
      lprintf("avcodec_decode_video: decoded_size=%d, got_picture=%d\n",
              len, got_picture);
      len = current - buf->content - offset;
-@@ -1112,7 +1115,7 @@ static void ff_handle_mpeg12_buffer (ff_
+@@ -1112,7 +1134,13 @@
  
      } else {
  
 -      if (this->context->hurry_up) {
-+      if (this->context->skip_frame > AVDISCARD_DEFAULT) {
++      if (
++#if AVVIDEO > 1
++        this->context->skip_frame != AVDISCARD_DEFAULT
++#else
++        this->context->hurry_up
++#endif
++       ) {
          /* skipped frame, output a bad frame */
          img = this->stream->video_out->get_frame (this->stream->video_out,
                                                    this->bih.biWidth,
-@@ -1303,13 +1306,16 @@ static void ff_handle_buffer (ff_video_d
-         this->size = 0;
+@@ -1304,13 +1332,25 @@
          got_picture = 0;
        } else {
-+        AVPacket pkt;
          /* skip decoding b frames if too late */
--        this->context->hurry_up = (this->skipframes > 0);
-+      this->context->skip_frame = (this->skipframes > 0? AVDISCARD_NONREF : AVDISCARD_DEFAULT);
++#if AVVIDEO > 1
++      this->context->skip_frame = (this->skipframes > 0) ? AVDISCARD_NONREF : AVDISCARD_DEFAULT;
++#else
+         this->context->hurry_up = (this->skipframes > 0);
+-
++#endif
          lprintf("buffer size: %d\n", this->size);
--        len = avcodec_decode_video (this->context, this->av_frame,
--                                    &got_picture, &chunk_buf[offset],
--                                    this->size);
-+      av_init_packet( &pkt );
-+      pkt.data = &chunk_buf[offset];
-+      pkt.size = this->size;
-+        len = avcodec_decode_video2 (this->context, this->av_frame,
-+                                    &got_picture, &pkt);
++#if AVVIDEO > 1
++      AVPacket avpkt;
++      av_init_packet(&avpkt);
++      avpkt.data = (uint8_t *)&chunk_buf[offset];
++      avpkt.size = this->size;
++      avpkt.flags = AV_PKT_FLAG_KEY;
++      len = avcodec_decode_video2 (this->context, this->av_frame,
++                                   &got_picture, &avpkt);
++#else
+         len = avcodec_decode_video (this->context, this->av_frame,
+                                     &got_picture, &chunk_buf[offset],
+                                     this->size);
+-
++#endif
  #ifdef AVCODEC_HAS_REORDERED_OPAQUE
          /* reset consumed pts value */
+         this->context->reordered_opaque = ff_tag_pts(this, 0);
+@@ -1432,7 +1472,7 @@
+                         img->base, img->pitches,
+                         img->width, img->height,
+                         this->av_frame->qscale_table, this->av_frame->qstride,
+-                        this->pp_mode, this->pp_context,
++                        this->our_mode, this->our_context,
+                         this->av_frame->pict_type);
+         } else if (!this->av_frame->opaque) {
+@@ -1676,11 +1716,11 @@
+     free(this->buf);
+   this->buf = NULL;
+-  if(this->pp_context)
+-    pp_free_context(this->pp_context);
++  if(this->our_context)
++    pp_free_context(this->our_context);
+-  if(this->pp_mode)
+-    pp_free_mode(this->pp_mode);
++  if(this->our_mode)
++    pp_free_mode(this->our_mode);
+   mpeg_parser_dispose(this->mpeg_parser);
+@@ -1721,8 +1761,8 @@
+   this->aspect_ratio      = 0;
+   this->pp_quality        = 0;
+-  this->pp_context        = NULL;
+-  this->pp_mode           = NULL;
++  this->our_context       = NULL;
++  this->our_mode          = NULL;
+   this->mpeg_parser       = NULL;
+diff -r 717450d734f7 src/post/planar/pp.c
+--- a/src/post/planar/pp.c     Mon May 16 15:49:02 2011 +0100
++++ b/src/post/planar/pp.c     Mon May 16 19:46:49 2011 -0400
+@@ -35,6 +35,12 @@
+ #  include <libpostproc/postprocess.h>
+ #endif
++#if LIBPOSTPROC_VERSION_MAJOR < 52
++#  define pp_context  pp_context_t
++#  define pp_mode     pp_mode_t
++#  define PP_PARAMETERS_T
++#endif
++
+ #define PP_STRING_SIZE 256 /* size of pp mode string (including all options) */
+ /* plugin class initialization function */
+@@ -76,14 +82,15 @@
+   /* libpostproc specific stuff */
+   int                pp_flags;
+-  pp_context_t      *pp_context;
+-  pp_mode_t         *pp_mode;
++  pp_context        *our_context;
++  pp_mode           *our_mode;
+   pthread_mutex_t    lock;
+ };
+ static int set_parameters (xine_post_t *this_gen, void *param_gen) {
++#ifdef PP_PARAMETERS_T
+   post_plugin_pp_t *this = (post_plugin_pp_t *)this_gen;
+   pp_parameters_t *param = (pp_parameters_t *)param_gen;
+@@ -92,17 +99,18 @@
+   memcpy( &this->params, param, sizeof(pp_parameters_t) );
+   pthread_mutex_unlock (&this->lock);
+-
++#endif
+   return 1;
+ }
+ static int get_parameters (xine_post_t *this_gen, void *param_gen) {
++#ifdef PP_PARAMETERS_T
+   post_plugin_pp_t *this = (post_plugin_pp_t *)this_gen;
+   pp_parameters_t *param = (pp_parameters_t *)param_gen;
+   memcpy( param, &this->params, sizeof(pp_parameters_t) );
+-
++#endif
+   return 1;
+ }
+@@ -202,8 +210,8 @@
+   if(cpu_caps & MM_ACCEL_X86_3DNOW)
+     this->pp_flags |= PP_CPU_CAPS_3DNOW;
+-  this->pp_mode = NULL;
+-  this->pp_context = NULL;
++  this->our_mode = NULL;
++  this->our_context = NULL;
+   pthread_mutex_init (&this->lock, NULL);
+@@ -248,13 +256,13 @@
+   post_plugin_pp_t *this = (post_plugin_pp_t *)this_gen;
+   if (_x_post_dispose(this_gen)) {
+-    if(this->pp_mode) {
+-      pp_free_mode(this->pp_mode);
+-      this->pp_mode = NULL;
++    if(this->our_mode) {
++      pp_free_mode(this->our_mode);
++      this->our_mode = NULL;
+     }
+-    if(this->pp_context) {
+-      pp_free_context(this->pp_context);
+-      this->pp_context = NULL;
++    if(this->our_context) {
++      pp_free_context(this->our_context);
++      this->our_context = NULL;
+     }
+     free(this);
+   }
+@@ -304,7 +312,7 @@
+     pthread_mutex_lock (&this->lock);
+-    if( !this->pp_context ||
++    if( !this->our_context ||
+         this->frame_width != yv12_frame->width ||
+         this->frame_height != yv12_frame->height ) {
+@@ -312,32 +320,32 @@
+       this->frame_height = yv12_frame->height;
+       pp_flags = this->pp_flags;
+-      if(this->pp_context)
+-        pp_free_context(this->pp_context);
++      if(this->our_context)
++        pp_free_context(this->our_context);
+-      this->pp_context = pp_get_context(frame->width, frame->height, pp_flags);
++      this->our_context = pp_get_context(frame->width, frame->height, pp_flags);
+-      if(this->pp_mode) {
+-        pp_free_mode(this->pp_mode);
+-        this->pp_mode = NULL;
++      if(this->our_mode) {
++        pp_free_mode(this->our_mode);
++        this->our_mode = NULL;
+       }
+     }
+-    if(!this->pp_mode)
+-      this->pp_mode = pp_get_mode_by_name_and_quality(this->params.mode,
++    if(!this->our_mode)
++      this->our_mode = pp_get_mode_by_name_and_quality(this->params.mode,
+                                                       this->params.quality);
+-    if(this->pp_mode)
++    if(this->our_mode)
+       pp_postprocess(yv12_frame->base, yv12_frame->pitches,
+                      out_frame->base, out_frame->pitches,
+                      (frame->width+7)&(~7), frame->height,
+                      NULL, 0,
+-                     this->pp_mode, this->pp_context,
++                     this->our_mode, this->our_context,
+                      0 /*this->av_frame->pict_type*/);
+     pthread_mutex_unlock (&this->lock);
+-    if(this->pp_mode) {
++    if(this->our_mode) {
+       skip = out_frame->draw(out_frame, stream);
+       _x_post_frame_copy_up(frame, out_frame);
+     } else {