Patch rebased to current patches backported from upstream by Alexis Ballier. Based on the previous patch, submitted upstream but not merged it seems: https://bugs.gentoo.org/406215 From c74abc298e2075f431d9fa700fcfc5e1bbbddf22 Mon Sep 17 00:00:00 2001 From: Tomas Chvatal Date: Fri, 23 Mar 2012 12:08:53 +0100 Subject: [PATCH 2/2] Add support for libav api as it sligthly differ. The libav use micro version as 0 The ffmpeg use the micro version as 100+ Simply check if the variable is defined then it is not libav. Index: xbmc-11.0/lib/DllAvFilter.h =================================================================== --- xbmc-11.0.orig/lib/DllAvFilter.h +++ xbmc-11.0/lib/DllAvFilter.h @@ -45,7 +45,11 @@ extern "C" { #if (defined HAVE_LIBAVFILTER_AVFILTER_H) #include #include - #include + #if LIBAVFILTER_VERSION_MICRO < 50 // Libav + #include + #else + #include + #endif #elif (defined HAVE_FFMPEG_AVFILTER_H) #include #include @@ -75,7 +79,11 @@ public: virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)=0; virtual int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)=0; #if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) +#if LIBAVFILTER_VERSION_MICRO < 50 // Libav + virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int64_t pts, AVRational pixel_aspect)=0; +#else virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; +#endif #else virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; #endif @@ -135,7 +143,11 @@ public: return ::avfilter_graph_config(graphctx, log_ctx); } #if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) +#if LIBAVFILTER_VERSION_MICRO < 50 // Libav + virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int64_t pts, AVRational pixel_aspect) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, pts, pixel_aspect); } +#else virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, flags); } +#endif #else virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame* frame, int flags) { return ::av_buffersrc_add_frame(buffer_filter, frame, flags); } #endif Index: xbmc-11.0/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp =================================================================== --- xbmc-11.0.orig/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ xbmc-11.0/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -833,7 +833,11 @@ int CDVDVideoCodecFFmpeg::FilterProcess( if (frame) { #if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) +#if LIBAVFILTER_VERSION_MICRO < 50 // Libav + result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame, frame->pts, m_pCodecContext->sample_aspect_ratio); +#else result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame, 0); +#endif #else result = m_dllAvFilter.av_buffersrc_add_frame(m_pFilterIn, frame, 0); #endif