commit af1baef4505ce9e061845dd64375b30f25072668
Author: Martin Gansser <mgansser(a)online.de>
Date: Thu Dec 27 18:55:53 2018 +0100
Add vdr-markad-ffmpeg4-fix.patch
vdr-markad-ffmpeg4-fix.patch | 86 +++++++++++++++++++++++++++++++++
vdr-markad.spec => vdr-markad-test.spec | 25 ++--------
2 files changed, 90 insertions(+), 21 deletions(-)
---
diff --git a/vdr-markad-ffmpeg4-fix.patch b/vdr-markad-ffmpeg4-fix.patch
new file mode 100644
index 0000000..bb943d2
--- /dev/null
+++ b/vdr-markad-ffmpeg4-fix.patch
@@ -0,0 +1,86 @@
+diff --git a/command/decoder.cpp b/command/decoder.cpp
+index 6400aa7..8cb14b9 100644
+--- a/command/decoder.cpp
++++ b/command/decoder.cpp
+@@ -180,16 +180,22 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threads)
+ }
+ else
+ {
++#ifdef AV_CODEC_ID_MPEG2VIDEO_XVMC
+ video_codecid=AV_CODEC_ID_MPEG2VIDEO_XVMC;
++#else
++ video_codecid=AV_CODEC_ID_MPEG2VIDEO;
++#endif
+ }
+
+ video_codec = avcodec_find_decoder(video_codecid);
++#ifdef AV_CODEC_ID_MPEG2VIDEO_XVMC
+ if ((!video_codec) && (video_codecid==AV_CODEC_ID_MPEG2VIDEO_XVMC))
+ {
+ // fallback to MPEG2VIDEO
+ video_codecid=AV_CODEC_ID_MPEG2VIDEO;
+ video_codec=avcodec_find_decoder(video_codecid);
+ }
++#endif
+
+ if (video_codec)
+ {
+@@ -200,17 +206,17 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threads)
+ #endif
+ if (video_context)
+ {
+- if (video_codec->capabilities & CODEC_CAP_TRUNCATED)
+- video_context->flags|=CODEC_FLAG_TRUNCATED; // we do not send
complete frames
+- video_context->flags|=CODEC_FLAG_LOW_DELAY;
+- video_context->flags2|=CODEC_FLAG2_FAST; // really?
++ if (video_codec->capabilities & AV_CODEC_CAP_TRUNCATED)
++ video_context->flags|=AV_CODEC_FLAG_TRUNCATED; // we do not send
complete frames
++ video_context->flags|=AV_CODEC_FLAG_LOW_DELAY;
++ video_context->flags2|=AV_CODEC_FLAG2_FAST; // really?
+ video_context->skip_idct=AVDISCARD_ALL;
+
+ if (video_codecid!=AV_CODEC_ID_H264)
+ {
+ video_context->skip_frame=AVDISCARD_NONKEY; // just I-frames
+ } else {
+- video_context->flags2|=CODEC_FLAG2_CHUNKS;
++ video_context->flags2|=AV_CODEC_FLAG2_CHUNKS;
+ #if LIBAVCODEC_VERSION_INT >= ((52<<16)+(47<<8)+0)
+ av_log_set_level(AV_LOG_FATAL); // silence decoder output
+ #else
+@@ -224,7 +230,11 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threads)
+ #else
+ int ret=avcodec_open(video_context, video_codec);
+ #endif
++#ifdef AV_CODEC_ID_MPEG2VIDEO_XVMC
+ if ((ret < 0) && (video_codecid==AV_CODEC_ID_MPEG2VIDEO_XVMC))
++#else
++ if (ret < 0)
++#endif
+ {
+ // fallback to MPEG2VIDEO
+ video_codecid=AV_CODEC_ID_MPEG2VIDEO;
+@@ -256,9 +266,11 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threads)
+ case AV_CODEC_ID_H264:
+ esyslog("could not open codec for H264");
+ break;
++#ifdef AV_CODEC_ID_MPEG2VIDEO_XVMC
+ case AV_CODEC_ID_MPEG2VIDEO_XVMC:
+ esyslog("could not open codec MPEG2 (XVMC)");
+ break;
++#endif
+ case AV_CODEC_ID_MPEG2VIDEO:
+ esyslog("could not open codec MPEG2");
+ break;
+@@ -322,9 +334,11 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, int Threads)
+ case AV_CODEC_ID_H264:
+ esyslog("codec for H264 not found");
+ break;
++#ifdef AV_CODEC_ID_MPEG2VIDEO_XVMC
+ case AV_CODEC_ID_MPEG2VIDEO_XVMC:
+ esyslog("codec for MPEG2 (XVMC) not found");
+ break;
++#endif
+ case AV_CODEC_ID_MPEG2VIDEO:
+ esyslog("codec for MPEG2 not found");
+ break;
diff --git a/vdr-markad.spec b/vdr-markad-test.spec
similarity index 92%
rename from vdr-markad.spec
rename to vdr-markad-test.spec
index 6679da6..29c8dc8 100644
--- a/vdr-markad.spec
+++ b/vdr-markad-test.spec
@@ -2,12 +2,6 @@
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
%global gitdate 20170313
-%if 0%{?fedora} > 27
-%bcond_without compat_ffmpeg
-%else
-%bcond_with compat_ffmpeg
-%endif
-
Name: vdr-markad
Version: 0.1.4
Release: 20.%{gitdate}git%{shortcommit0}%{?dist}
@@ -19,32 +13,21 @@ License: GPLv2+
URL:
http://projects.vdr-developer.org/projects/plg-markad
Source0:
http://projects.vdr-developer.org/git/vdr-plugin-markad.git/snapshot/vdr-...
Source1: %{name}.conf
+#Patch0: markad_ffmpeg4.diff
+Patch0: %{name}-ffmpeg4-fix.patch
BuildRequires: gcc-c++
BuildRequires: vdr-devel >= 1.7.30
-%if %{with compat_ffmpeg}
-BuildRequires: compat-ffmpeg28-devel
-%else
BuildRequires: ffmpeg-devel
-%endif
Requires: vdr(abi)%{?_isa} = %{vdr_apiversion}
%description
VDR-Plugin: markad - %{summary}
%prep
-%autosetup p1 1 -n vdr-plugin-markad-%{commit0}
-
-%if ! %{with compat_ffmpeg}
-# ffmpeg3 patch
-# replaced function avcodec_alloc_frame(); by av_frame_alloc();
-sed -i -e 's|avcodec_alloc_frame()|av_frame_alloc()|g' command/decoder.cpp
-%endif
+%autosetup -p 1 -n vdr-plugin-markad-%{commit0}
%build
-%if %{with compat_ffmpeg}
-export PKG_CONFIG_PATH=%{_libdir}/compat-ffmpeg28/pkgconfig
-%endif
make CFLAGS="%{optflags} -fPIC" CXXFLAGS="%{optflags} -fPIC"
%{?_smp_mflags} \
LIBDIR=. VDRDIR=%{_libdir}/vdr VDRINCDIR=%{_includedir} \
LOCALEDIR=./locale all
@@ -89,7 +72,7 @@ fi
%changelog
* Thu Dec 27 2018 Martin Gansser <martinkg(a)fedoraproject.org> -
0.1.4-20.20170313gitea2e182
-- Add markad_ffmpeg4.diff
+- Add vdr-markad-ffmpeg4-fix.patch
* Thu Oct 11 2018 Martin Gansser <martinkg(a)fedoraproject.org> -
0.1.4-19.20170313gitea2e182
- Add BR gcc-c++