[xine-lib] Add patch to build with ffmpeg3

Sérgio M. Basto sergiomb at rpmfusion.org
Tue Jun 14 17:49:54 CEST 2016


commit fc4650d8870c5242d4244ab0cf5393fef61a0e5c
Author: Sérgio M. Basto <sergio at serjux.com>
Date:   Sun May 1 04:06:38 2016 +0100

    Add patch to build with ffmpeg3

 ffmpeg_2.9.patch | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 xine-lib.spec    |  7 +++++-
 2 files changed, 79 insertions(+), 1 deletion(-)
---
diff --git a/ffmpeg_2.9.patch b/ffmpeg_2.9.patch
new file mode 100644
index 0000000..7df1aab
--- /dev/null
+++ b/ffmpeg_2.9.patch
@@ -0,0 +1,73 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun <Andreas.Cadhalpun at 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/xine-lib.spec b/xine-lib.spec
index 5f54bba..4b148ca 100644
--- a/xine-lib.spec
+++ b/xine-lib.spec
@@ -10,13 +10,14 @@
 Summary:        A multimedia engine
 Name:           xine-lib
 Version:        1.2.6
-Release:        8%{?dist}
+Release:        9%{?dist}
 License:        GPLv2+
 URL:            http://www.xine-project.org/
 Source0:        http://downloads.sourceforge.net/xine/xine-lib-%{version}.tar.xz
 
 # http://bugzilla.redhat.com/477226
 Patch1:         xine-lib-1.1.16.2-multilib.patch
+Patch2:         ffmpeg_2.9.patch
 
 Provides:         xine-lib(plugin-abi) = %{plugin_abi}
 %{?_isa:Provides: xine-lib(plugin-abi)%{?_isa} = %{plugin_abi}}
@@ -107,6 +108,7 @@ This package contains extra plugins for %{name}:
 %prep
 %setup -q
 %patch1 -p1 -b .multilib
+%patch2 -p1 -b .ffmpeg_2.9
 
 
 %build
@@ -328,6 +330,9 @@ mkdir -p $RPM_BUILD_ROOT%{codecdir}
 
 
 %changelog
+* Sun May 01 2016 Sérgio Basto <sergio at serjux.com> - 1.2.6-9
+- Add patch to build with ffmpeg3
+
 * Tue Nov 04 2014 Nicolas Chauvet <kwizart at gmail.com> - 1.2.6-8
 - Rebuilt for vaapi 0.36
 


More information about the rpmfusion-commits mailing list