commit 4100402de83e8113208bf226eaacd34ebba9d7ff
Author: Mohamed El Morabity <melmorabity(a)fedoraproject.org>
Date: Tue Jan 23 14:53:12 2018 +0100
Fix build with FFmpeg 3.5
tvheadend-4.2.5-ffmpeg_3.5.patch | 115 +++++++++++++++++++++++++++++++++++++++
tvheadend.spec | 7 ++-
2 files changed, 121 insertions(+), 1 deletion(-)
---
diff --git a/tvheadend-4.2.5-ffmpeg_3.5.patch b/tvheadend-4.2.5-ffmpeg_3.5.patch
new file mode 100644
index 0000000..eaec90e
--- /dev/null
+++ b/tvheadend-4.2.5-ffmpeg_3.5.patch
@@ -0,0 +1,115 @@
+diff -up ./src/muxer/muxer_libav.c.orig ./src/muxer/muxer_libav.c
+--- ./src/muxer/muxer_libav.c.orig 2017-12-18 09:57:28.000000000 +0100
++++ ./src/muxer/muxer_libav.c 2018-01-23 14:24:07.923509542 +0100
+@@ -174,7 +174,7 @@ lav_muxer_add_stream(lav_muxer_t *lm,
+ }
+
+ if(lm->lm_oc->oformat->flags & AVFMT_GLOBALHEADER)
+- c->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+
+ return 0;
+ }
+diff -up ./src/plumbing/transcoding.c.orig ./src/plumbing/transcoding.c
+--- ./src/plumbing/transcoding.c.orig 2017-12-18 09:57:28.000000000 +0100
++++ ./src/plumbing/transcoding.c 2018-01-23 14:43:14.873964416 +0100
+@@ -19,7 +19,7 @@
+ #include <unistd.h>
+ #include <libavformat/avformat.h>
+ #include <libavcodec/avcodec.h>
+-#include <libavfilter/avfiltergraph.h>
++#include <libavfilter/avfilter.h>
+ #include <libavfilter/buffersink.h>
+ #include <libavfilter/buffersrc.h>
+ #include <libavutil/opt.h>
+@@ -574,7 +574,7 @@ transcoder_stream_audio(transcoder_t *t,
+ octx->channels = as->aud_channels ? as->aud_channels :
ictx->channels;
+ octx->channel_layout = transcode_get_channel_layout(&octx->channels,
ocodec);
+ octx->bit_rate = as->aud_bitrate ? as->aud_bitrate : 0;
+- octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ octx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+
+ if (!octx->sample_rate) {
+ tvherror(LS_TRANSCODE, "%04X: audio encoder has no suitable sample
rate!", shortid(t));
+@@ -619,7 +619,7 @@ transcoder_stream_audio(transcoder_t *t,
+ break;
+
+ case SCT_AAC:
+- octx->flags |= CODEC_FLAG_BITEXACT;
++ octx->flags |= AV_CODEC_FLAG_BITEXACT;
+ // use 64 kbit per channel as default
+ if (octx->bit_rate == 0) {
+ octx->bit_rate = octx->channels * 64000;
+@@ -630,10 +630,10 @@ transcoder_stream_audio(transcoder_t *t,
+ // use vbr with quality setting as default
+ // and also use a user specified bitrate < 16 kbit as quality setting
+ if (octx->bit_rate == 0) {
+- octx->flags |= CODEC_FLAG_QSCALE;
++ octx->flags |= AV_CODEC_FLAG_QSCALE;
+ octx->global_quality = 4 * FF_QP2LAMBDA;
+ } else if (t->t_props.tp_abitrate < 16) {
+- octx->flags |= CODEC_FLAG_QSCALE;
++ octx->flags |= AV_CODEC_FLAG_QSCALE;
+ octx->global_quality = t->t_props.tp_abitrate * FF_QP2LAMBDA;
+ octx->bit_rate = 0;
+ }
+@@ -1048,7 +1048,7 @@ create_video_filter(video_stream_t *vs,
+ AVCodecContext *ictx, AVCodecContext *octx)
+ {
+ AVFilterInOut *flt_inputs, *flt_outputs;
+- AVFilter *flt_bufsrc, *flt_bufsink;
++ const AVFilter *flt_bufsrc, *flt_bufsink;
+ enum AVPixelFormat pix_fmts[] = { 0, AV_PIX_FMT_NONE };
+ char opt[128];
+ int err;
+@@ -1289,12 +1289,12 @@ transcoder_stream_video(transcoder_t *t,
+ else
+ octx->pix_fmt = AV_PIX_FMT_YUV420P;
+
+- octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ octx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+
+ if (t->t_props.tp_vbitrate < 64) {
+ // encode with specified quality and optimize for low latency
+ // valid values for quality are 2-31, smaller means better quality, use 5 as
default
+- octx->flags |= CODEC_FLAG_QSCALE;
++ octx->flags |= AV_CODEC_FLAG_QSCALE;
+ octx->global_quality = FF_QP2LAMBDA *
+ (t->t_props.tp_vbitrate == 0 ? 5 : MINMAX(t->t_props.tp_vbitrate, 2,
31));
+ } else {
+@@ -1340,7 +1340,7 @@ transcoder_stream_video(transcoder_t *t,
+ else
+ octx->pix_fmt = AV_PIX_FMT_YUV420P;
+
+- octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ octx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+
+ // Default = "medium". We gain more encoding speed compared to the loss
of quality when lowering it _slightly_.
+ // select preset according to system performance and codec type
+@@ -1371,7 +1371,7 @@ transcoder_stream_video(transcoder_t *t,
+
+ case SCT_HEVC:
+ octx->pix_fmt = AV_PIX_FMT_YUV420P;
+- octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
++ octx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+
+ // on all hardware ultrafast (or maybe superfast) should be safe
+ // select preset according to system performance
+@@ -2177,7 +2177,7 @@ transcoder_get_capabilities(int experime
+ if (!WORKING_ENCODER(p->id))
+ continue;
+
+- if (((p->capabilities & CODEC_CAP_EXPERIMENTAL) && !experimental) ||
++ if (((p->capabilities & AV_CODEC_CAP_EXPERIMENTAL) && !experimental)
||
+ (p->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)) {
+ continue;
+ }
+@@ -2192,7 +2192,7 @@ transcoder_get_capabilities(int experime
+ htsmsg_add_str(m, "name", p->name);
+ snprintf(buf, sizeof(buf), "%s%s",
+ p->long_name ?: "",
+- (p->capabilities & CODEC_CAP_EXPERIMENTAL) ?
++ (p->capabilities & AV_CODEC_CAP_EXPERIMENTAL) ?
+ " (Experimental)" : "");
+ if (buf[0] != '\0')
+ htsmsg_add_str(m, "long_name", buf);
diff --git a/tvheadend.spec b/tvheadend.spec
index 56891f1..551c2fb 100644
--- a/tvheadend.spec
+++ b/tvheadend.spec
@@ -3,7 +3,7 @@
Name: tvheadend
Version: 4.2.5
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: TV streaming server and digital video recorder
Group: Applications/Multimedia
@@ -24,6 +24,8 @@ Patch3: %{name}-4.2.2-dtv_scan_tables.patch
# Enforcing system crypto policies, see
#
https://fedoraproject.org/wiki/Packaging:CryptoPolicies
Patch4: %{name}-4.2.1-crypto_policies.patch
+# Fix build with FFmpeg 3.5
+Patch5: %{name}-4.2.5-ffmpeg_3.5.patch
BuildRequires: bzip2
BuildRequires: gcc
@@ -148,6 +150,9 @@ exit 0
%changelog
+* Tue Jan 23 2018 root - 4.2.5-3
+- Fix build with FFmpeg 3.5
+
* Thu Jan 18 2018 Leigh Scott <leigh123linux(a)googlemail.com> - 4.2.5-2
- Rebuilt for ffmpeg-3.5 git