forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xbmc-11.0-libav.patch
72 lines (67 loc) · 3.55 KB
/
xbmc-11.0-libav.patch
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
https://bugs.gentoo.org/406215
From c74abc298e2075f431d9fa700fcfc5e1bbbddf22 Mon Sep 17 00:00:00 2001
From: Tomas Chvatal <[email protected]>
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.
---
lib/DllAvFilter.h | 10 +++++++++-
.../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 4 ++++
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h
index 302e35c..827746e 100644
--- a/lib/DllAvFilter.h
+++ b/lib/DllAvFilter.h
@@ -48,7 +48,7 @@ extern "C" {
#endif
/* for av_vsrc_buffer_add_frame */
#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,8,0)
- #include <libavfilter/avcodec.h>
+ #include <libavfilter/vsrc_buffer.h>
#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,7,0)
int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter,
AVFrame *frame);
@@ -83,7 +83,11 @@ public:
virtual int avfilter_poll_frame(AVFilterLink *link)=0;
virtual int avfilter_request_frame(AVFilterLink *link)=0;
#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,13,0)
+#if LIBAVFILTER_VERSION_MICRO
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0;
+#else
+ virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int64_t pts, AVRational pixel_aspect)=0;
+#endif
#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,7,0)
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame)=0;
#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,3,0)
@@ -172,7 +176,11 @@ public:
virtual int avfilter_poll_frame(AVFilterLink *link) { return ::avfilter_poll_frame(link); }
virtual int avfilter_request_frame(AVFilterLink *link) { return ::avfilter_request_frame(link); }
#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,13,0)
+#if LIBAVFILTER_VERSION_MICRO
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, flags); }
+#else
+ 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); }
+#endif
#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,7,0)
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame); }
#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,3,0)
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
index b4e1451..4e5eedf 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
@@ -814,7 +814,11 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame)
if (frame)
{
#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,13,0)
+#if LIBAVFILTER_VERSION_MICRO
result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame, 0);
+#else
+ result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame, frame->pts, m_pCodecContext->sample_aspect_ratio);
+#endif
#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,7,0)
result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame);
#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,3,0)
--
1.7.3.4