Package: xine-lib-1.2
Version: 1.2.6-1
Severity: important
Tags: patch
User: pkg-multimedia-maintain...@lists.alioth.debian.org
Usertags: ffmpeg2.9

Dear Maintainer,

your package fails to build with the upcoming ffmpeg 2.9.
This bug will become release-critical at some point when the
ffmpeg2.9 transition gets closer.

Attached is a patch replacing the deprecated functionality.
It also works with ffmpeg 2.8.
Please apply this patch and forward it upstream, if necessary.

These changes have little regression potential.

Best regards,
Andreas

diff --git a/debian/patches/ffmpeg_2.9.patch b/debian/patches/ffmpeg_2.9.patch
new file mode 100644
index 0000000..3f084e2
--- /dev/null
+++ b/debian/patches/ffmpeg_2.9.patch
@@ -0,0 +1,73 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
+Last-Update: <2015-11-02>
+
+--- xine-lib-1.2-1.2.6.orig/src/combined/ffmpeg/ff_audio_decoder.c
++++ xine-lib-1.2-1.2.6/src/combined/ffmpeg/ff_audio_decoder.c
+@@ -590,7 +590,7 @@ static int ff_audio_decode (ff_audio_dec
+   int got_frame;
+   float gain = this->class->gain;
+   if (!this->av_frame)
+-    this->av_frame = avcodec_alloc_frame ();
++    this->av_frame = av_frame_alloc ();
+ 
+   consumed = avcodec_decode_audio4 (this->context, this->av_frame, &got_frame, &avpkt);
+   if ((consumed >= 0) && got_frame) {
+@@ -1071,7 +1071,7 @@ static void ff_audio_reset (audio_decode
+   /* try to reset the wma decoder */
+   if( this->decoder_ok ) {
+ #if AVAUDIO > 3
+-    avcodec_free_frame (&this->av_frame);
++    av_frame_free (&this->av_frame);
+ #endif
+     pthread_mutex_lock (&ffmpeg_lock);
+     avcodec_close (this->context);
+@@ -1105,7 +1105,7 @@ static void ff_audio_dispose (audio_deco
+ 
+   if( this->context && this->decoder_ok ) {
+ #if AVAUDIO > 3
+-    avcodec_free_frame (&this->av_frame);
++    av_frame_free (&this->av_frame);
+ #endif
+     pthread_mutex_lock (&ffmpeg_lock);
+     avcodec_close (this->context);
+--- xine-lib-1.2-1.2.6.orig/src/combined/ffmpeg/ff_video_decoder.c
++++ xine-lib-1.2-1.2.6/src/combined/ffmpeg/ff_video_decoder.c
+@@ -2481,7 +2481,7 @@ static void ff_dispose (video_decoder_t
+     av_free( this->context );
+ 
+   if( this->av_frame )
+-    av_free( this->av_frame );
++    av_frame_free( &this->av_frame );
+ 
+   if (this->buf)
+     free(this->buf);
+@@ -2523,7 +2523,7 @@ static video_decoder_t *ff_video_open_pl
+   this->stream                            = stream;
+   this->class                             = (ff_video_class_t *) class_gen;
+ 
+-  this->av_frame          = avcodec_alloc_frame();
++  this->av_frame          = av_frame_alloc();
+   this->context           = avcodec_alloc_context();
+   this->context->opaque   = this;
+ #if AVPALETTE == 1
+--- xine-lib-1.2-1.2.6.orig/src/dxr3/ffmpeg_encoder.c
++++ xine-lib-1.2-1.2.6/src/dxr3/ffmpeg_encoder.c
+@@ -161,7 +161,7 @@ static int lavc_on_update_format(dxr3_dr
+       "dxr3_mpeg_encoder: Couldn't start the ffmpeg library\n");
+     return 0;
+   }
+-  this->picture = avcodec_alloc_frame();
++  this->picture = av_frame_alloc();
+   if (!this->picture) {
+     xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
+       "dxr3_mpeg_encoder: Couldn't allocate ffmpeg frame\n");
+@@ -320,7 +320,7 @@ static int lavc_on_unneeded(dxr3_driver_
+   if (this->context) {
+     avcodec_close(this->context);
+     free(this->context);
+-    free(this->picture);
++    av_frame_free(&this->picture);
+     this->context = NULL;
+     this->picture = NULL;
+   }
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..a827249
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+ffmpeg_2.9.patch

Reply via email to