[packages/xbmc] - fix build with ffmpeg2

baggins baggins at pld-linux.org
Thu Aug 29 10:20:22 CEST 2013


commit bfa116d7f597e236b78a5e9a49ff522e65f22eaa
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Thu Aug 29 10:20:07 2013 +0200

    - fix build with ffmpeg2

 ffmpeg2.patch | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 xbmc.spec     |   2 +
 2 files changed, 117 insertions(+)
---
diff --git a/xbmc.spec b/xbmc.spec
index ace041d..7f32ccd 100644
--- a/xbmc.spec
+++ b/xbmc.spec
@@ -18,6 +18,7 @@ License:	GPL v2+ and GPL v3+
 Group:		Applications/Multimedia
 Source0:	http://mirrors.xbmc.org/releases/source/%{name}-%{version}.tar.gz
 # Source0-md5:	489f3877decae4e265ece54f9eaef0ba
+Patch0:		ffmpeg2.patch
 URL:		http://xbmc.org/
 BuildRequires:	Mesa-libGLU-devel
 BuildRequires:	OpenGL-devel
@@ -124,6 +125,7 @@ forecast functions, together third-party plugins.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 ./bootstrap
diff --git a/ffmpeg2.patch b/ffmpeg2.patch
new file mode 100644
index 0000000..c2b6604
--- /dev/null
+++ b/ffmpeg2.patch
@@ -0,0 +1,115 @@
+From 9f24c9a44aa625277e5c5f1d251cff262d0bc259 Mon Sep 17 00:00:00 2001
+From: FlyingRat <flyingrat at outlook.com>
+Date: Mon, 29 Apr 2013 10:49:06 +0200
+Subject: [PATCH] xbmc adjustments for ffmpeg master head, rev b691bc4,
+ 2013-04-29
+
+---
+ lib/DllAvCodec.h                                   |  8 +++
+ lib/DllAvFilter.h                                  | 15 ++++--
+ xbmc/cores/dvdplayer/DVDAudio.h                    |  5 ++
+ .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp        |  2 +
+ xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h        |  5 ++
+ 6 files changed, 94 insertions(+), 3 deletions(-)
+ create mode 100755 lib/ffmpeg/build_xbmc_win32.sh
+
+diff --git a/lib/DllAvCodec.h b/lib/DllAvCodec.h
+index 2b4ee22..5114a65 100644
+--- a/lib/DllAvCodec.h
++++ b/lib/DllAvCodec.h
+@@ -41,6 +41,14 @@
+ #ifndef __GNUC__
+ #pragma warning(disable:4244)
+ #endif
++    
++#if !defined(CodecID)				// @FFMPEGHEAD TODO: CodecID decrepated and autodef removed, define/rename AVCodecID globaly?
++#define CodecID AVCodecID
++#endif
++
++#if !defined(AVCODEC_MAX_AUDIO_FRAME_SIZE)	// @FFMPEGHEAD TODO: stick with this or check for possible other solution?
++#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000	// 1 second of 48khz 32bit audio (defintion orginated from ffmpeg)
++#endif
+ 
+ #if (defined USE_EXTERNAL_FFMPEG)
+   #if (defined HAVE_LIBAVCODEC_AVCODEC_H)
+diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h
+index d44b918..5082618 100644
+--- a/lib/DllAvFilter.h
++++ b/lib/DllAvFilter.h
+@@ -20,6 +20,9 @@
+  *
+  */
+ 
++// #define av_buffersrc_add_frame(ctx,frame) av_buffersrc_add_frame_flags(ctx, frame, 0);
++
++
+ #if (defined HAVE_CONFIG_H) && (!defined WIN32)
+   #include "config.h"
+ #endif
+@@ -56,6 +59,9 @@
+   #include "libavfilter/buffersink.h"
+   #include "libavfilter/avcodec.h"
+ #endif
++
++#include "libavfilter/buffersrc.h"  // @FFMPEGHEAD temp hack
++    
+ }
+ 
+ #if LIBAVFILTER_VERSION_MICRO >= 100
+@@ -146,9 +153,9 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface
+     return ::avfilter_graph_config(graphctx, log_ctx);
+   }
+ #if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0)
+-  virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, flags); }
++  virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) { return ::av_vsrc_buffer_add_frame_flags(buffer_filter, frame, flags); }
+ #else
+-  virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame* frame, int flags) { return ::av_buffersrc_add_frame(buffer_filter, frame, flags); }
++  virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame* frame, int flags) { return ::av_buffersrc_add_frame_flags(buffer_filter, frame, flags); }
+ #endif
+   virtual void avfilter_unref_buffer(AVFilterBufferRef *ref) { ::avfilter_unref_buffer(ref); }
+   virtual int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad) { return ::avfilter_link(src, srcpad, dst, dstpad); }
+diff --git a/xbmc/cores/dvdplayer/DVDAudio.h b/xbmc/cores/dvdplayer/DVDAudio.h
+index e76d443..1a1b840 100644
+--- a/xbmc/cores/dvdplayer/DVDAudio.h
++++ b/xbmc/cores/dvdplayer/DVDAudio.h
+@@ -42,6 +43,10 @@
+ #endif
+ }
+ #endif
++#if !defined (CodecID)
++#define CodecID AVCodecID       //@FFMPEGHEAD TODO: CodecID decrepated and autodef removed, possible rename to AVCodecID globaly?
++#endif
++
+ typedef struct stDVDAudioFrame DVDAudioFrame;
+ 
+ class CPTSOutputQueue
+diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
+index eb45f9a..33c9da0 100644
+--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
+@@ -18,6 +18,8 @@
+  *
+  */
+ 
++#define FF_API_AVFILTERBUFFER 1		// @FFMPEGHEAD enable av_buffersrc_buffer & co. TODO: check for alt sol.
++
+ #include "system.h"
+ #if (defined HAVE_CONFIG_H) && (!defined WIN32)
+   #include "config.h"
+diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h
+index bdad65b..8db5d7b 100644
+--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h
++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h
+@@ -51,6 +52,10 @@
+ }
+ #endif
+ 
++#if !defined (CodecID)
++#define CodecID AVCodecID       //@FFMPEGHEAD TODO: CodecID decrepated and autodef removed, possible rename to AVCodecID glob
++#endif
++
+ #ifndef __GNUC__
+ #pragma warning(pop)
+ #endif
+-- 
+1.8.1.6
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xbmc.git/commitdiff/bfa116d7f597e236b78a5e9a49ff522e65f22eaa



More information about the pld-cvs-commit mailing list