summaryrefslogtreecommitdiff
path: root/media-tv/xbmc/files/xbmc-11.0-libav-r1.patch
blob: 84a215a7268431260d3dcb5f57263024d7955760 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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 <tchvatal@suse.cz>
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 <libavfilter/avfiltergraph.h>
     #include <libavfilter/buffersink.h>
-    #include <libavfilter/avcodec.h>
+    #if LIBAVFILTER_VERSION_MICRO < 50 // Libav
+      #include <libavfilter/vsrc_buffer.h>
+    #else
+      #include <libavfilter/avcodec.h>
+    #endif
   #elif (defined HAVE_FFMPEG_AVFILTER_H)
     #include <ffmpeg/avfiltergraph.h>
     #include <ffmpeg/buffersink.h>
@@ -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