+++ /dev/null
-From 8bd059550c641fcaae3a360c527ada6ec74ce9e7 Mon Sep 17 00:00:00 2001
-From: Flole998 <Flole998@users.noreply.github.com>
-Date: Mon, 8 Jun 2020 21:43:18 +0200
-Subject: [PATCH] Allocate space for buf on heap (modified PR #1324)
-
----
- src/epggrab/module/xmltv.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/src/epggrab/module/xmltv.c b/src/epggrab/module/xmltv.c
-index 34ab05bdb7..d48bdbbb1e 100644
---- a/src/epggrab/module/xmltv.c
-+++ b/src/epggrab/module/xmltv.c
-@@ -197,11 +197,12 @@ static void parse_xmltv_dd_progid
- (epggrab_module_t *mod, const char *s, char **uri, char **suri,
- epg_episode_num_t *epnum)
- {
-- char buf[128];
- if (strlen(s) < 2) return;
-
-+ const int buf_size = s_len + strlen(mod->id) + 13;
-+ char * buf = (char *) malloc( buf_size);
- /* Raw URI */
-- snprintf(buf, sizeof(buf)-1, "ddprogid://%s/%s", mod->id, s);
-+ int e = snprintf( buf, buf_size, "ddprogid://%s/%s", mod->id, s);
-
- /* SH - series without episode id so ignore */
- if (strncmp("SH", s, 2))
-@@ -212,7 +213,7 @@ static void parse_xmltv_dd_progid
- /* Episode */
- if (!strncmp("EP", s, 2)) {
- int e = strlen(buf)-1;
-- while (e && buf[e] != '.') e--;
-+ while (--e && buf[e] != '.') {}
- if (e) {
- buf[e] = '\0';
- *suri = strdup(buf);
-From e1031ce5d55275e1606643133b8168adcbe5f231 Mon Sep 17 00:00:00 2001
-From: Flole998 <Flole998@users.noreply.github.com>
-Date: Mon, 8 Jun 2020 21:46:22 +0200
-Subject: [PATCH] Allocate space for buf on heap (modified PR #1324)
-
----
- src/epggrab/module/xmltv.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/epggrab/module/xmltv.c b/src/epggrab/module/xmltv.c
-index d48bdbbb1e..fa36640f7e 100644
---- a/src/epggrab/module/xmltv.c
-+++ b/src/epggrab/module/xmltv.c
-@@ -197,7 +197,8 @@ static void parse_xmltv_dd_progid
- (epggrab_module_t *mod, const char *s, char **uri, char **suri,
- epg_episode_num_t *epnum)
- {
-- if (strlen(s) < 2) return;
-+ const int s_len = strlen(s);
-+ if (s_len < 2) return;
-
- const int buf_size = s_len + strlen(mod->id) + 13;
- char * buf = (char *) malloc( buf_size);
-@@ -212,7 +213,6 @@ static void parse_xmltv_dd_progid
-
- /* Episode */
- if (!strncmp("EP", s, 2)) {
-- int e = strlen(buf)-1;
- while (--e && buf[e] != '.') {}
- if (e) {
- buf[e] = '\0';
-From 51a4c5bec7b6fc69dab7b8d559f9b1b881f0eb8e Mon Sep 17 00:00:00 2001
-From: Flole998 <Flole998@users.noreply.github.com>
-Date: Wed, 10 Jun 2020 23:27:21 +0200
-Subject: [PATCH] Fix memory leak
-
----
- src/epggrab/module/xmltv.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/epggrab/module/xmltv.c b/src/epggrab/module/xmltv.c
-index fa36640f7e..6f09f3e18a 100644
---- a/src/epggrab/module/xmltv.c
-+++ b/src/epggrab/module/xmltv.c
-@@ -220,6 +220,7 @@ static void parse_xmltv_dd_progid
- if (buf[e+1]) sscanf(&buf[e+1], "%hu", &(epnum->e_num));
- }
- }
-+ free(buf);
- }
-
- /**
+++ /dev/null
-From 1f2a0a59e3acaef88509d3ac899b905c73b7b8f8 Mon Sep 17 00:00:00 2001
-From: James Le Cuirot <chewi@gentoo.org>
-Date: Fri, 15 May 2020 17:45:30 +0100
-Subject: [PATCH] Fix building with -fno-common (default from GCC 10)
-
----
- src/input.h | 4 ++--
- src/input/mpegts.c | 2 ++
- src/input/mpegts.h | 2 +-
- 3 files changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/src/input.h b/src/input.h
-index a9c96df04..3dce355c6 100644
---- a/src/input.h
-+++ b/src/input.h
-@@ -133,8 +133,8 @@ void tvh_hardware_delete ( tvh_hardware_t *th );
- extern const idclass_t tvh_input_class;
- extern const idclass_t tvh_input_instance_class;
-
--tvh_input_list_t tvh_inputs;
--tvh_hardware_list_t tvh_hardware;
-+extern tvh_input_list_t tvh_inputs;
-+extern tvh_hardware_list_t tvh_hardware;
-
- #define TVH_INPUT_FOREACH(x) LIST_FOREACH(x, &tvh_inputs, ti_link)
- #define TVH_HARDWARE_FOREACH(x) LIST_FOREACH(x, &tvh_hardware, th_link)
-diff --git a/src/input/mpegts.c b/src/input/mpegts.c
-index e02d491f1..fca4f3429 100644
---- a/src/input/mpegts.c
-+++ b/src/input/mpegts.c
-@@ -20,6 +20,8 @@
- #include "mpegts/fastscan.h"
- #include "memoryinfo.h"
-
-+struct mpegts_listeners mpegts_listeners;
-+
- extern memoryinfo_t mpegts_input_queue_memoryinfo;
- extern memoryinfo_t mpegts_input_table_memoryinfo;
-
-diff --git a/src/input/mpegts.h b/src/input/mpegts.h
-index 9dda3baca..9c4c57b73 100644
---- a/src/input/mpegts.h
-+++ b/src/input/mpegts.h
-@@ -1149,7 +1149,7 @@ typedef struct mpegts_listener
- void (*ml_mux_delete) (mpegts_mux_t *mm, void *p);
- } mpegts_listener_t;
-
--LIST_HEAD(,mpegts_listener) mpegts_listeners;
-+extern LIST_HEAD(mpegts_listeners, mpegts_listener) mpegts_listeners;
-
- #define mpegts_add_listener(ml)\
- LIST_INSERT_HEAD(&mpegts_listeners, ml, ml_link)
---
-2.26.2
-
+++ /dev/null
-From 8de98367c223d9e2899acd787a8e2ce55b1a1c37 Mon Sep 17 00:00:00 2001
-From: Niels Ole Salscheider <niels_ole@salscheider-online.de>
-Date: Sun, 3 Feb 2019 11:01:01 +0100
-Subject: [PATCH] Replace strncpy with strlcpy
-
-Without this patch, tvheadend does not compile with GCC 8.
----
- src/plumbing/transcoding.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/src/plumbing/transcoding.c b/src/plumbing/transcoding.c
-index cf48f9b36c..6ff1665f8f 100644
---- a/src/plumbing/transcoding.c
-+++ b/src/plumbing/transcoding.c
-@@ -1804,7 +1804,7 @@ transcoder_init_video(transcoder_t *t, streaming_start_component_t *ssc)
- char *str, *token, *saveptr, codec_list[sizeof(tp->tp_src_vcodec)];
- int codec_match=0;
-
-- strncpy(codec_list, tp->tp_src_vcodec, sizeof(tp->tp_src_vcodec)-1);
-+ strlcpy(codec_list, tp->tp_src_vcodec, sizeof(codec_list));
-
- tvhtrace(LS_TRANSCODE, "src_vcodec=\"%s\" ssc_type=%d (%s)\n",
- tp->tp_src_vcodec,
-@@ -2130,10 +2130,10 @@ transcoder_set_properties(streaming_target_t *st,
- transcoder_t *t = (transcoder_t *)st;
- transcoder_props_t *tp = &t->t_props;
-
-- strncpy(tp->tp_vcodec, props->tp_vcodec, sizeof(tp->tp_vcodec)-1);
-- strncpy(tp->tp_vcodec_preset, props->tp_vcodec_preset, sizeof(tp->tp_vcodec_preset)-1);
-- strncpy(tp->tp_acodec, props->tp_acodec, sizeof(tp->tp_acodec)-1);
-- strncpy(tp->tp_scodec, props->tp_scodec, sizeof(tp->tp_scodec)-1);
-+ strlcpy(tp->tp_vcodec, props->tp_vcodec, sizeof(tp->tp_vcodec));
-+ strlcpy(tp->tp_vcodec_preset, props->tp_vcodec_preset, sizeof(tp->tp_vcodec_preset));
-+ strlcpy(tp->tp_acodec, props->tp_acodec, sizeof(tp->tp_acodec));
-+ strlcpy(tp->tp_scodec, props->tp_scodec, sizeof(tp->tp_scodec));
- tp->tp_channels = props->tp_channels;
- tp->tp_vbitrate = props->tp_vbitrate;
- tp->tp_abitrate = props->tp_abitrate;
-@@ -2141,7 +2141,7 @@ transcoder_set_properties(streaming_target_t *st,
-
- memcpy(tp->tp_language, props->tp_language, 4);
-
-- strncpy(tp->tp_src_vcodec, props->tp_src_vcodec, sizeof(tp->tp_src_vcodec)-1);
-+ strlcpy(tp->tp_src_vcodec, props->tp_src_vcodec, sizeof(tp->tp_src_vcodec));
- }
-
-
# Conditional build:
%bcond_without systemd # without systemd support
+%define gitref 637844055c186e981495da711e4887806f656c98
+%define snap 20210531
+
Summary: TV streaming server
Name: tvheadend
# https://tvheadend.org/projects/tvheadend/wiki/Releases
-Version: 4.2.8
-Release: 1
+Version: 4.3.0
+Release: 0.%{snap}.1
License: GPL v3
Group: Applications/Multimedia
-Source0: https://github.com/tvheadend/tvheadend/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: b9571efa46dd489f9fe87acdb391d591
+Source0: https://github.com/tvheadend/tvheadend/archive/%{gitref}/%{name}-%{snap}.tar.gz
+# Source0-md5: 9d5f4e06a458ea221e9c218837e817fa
Source1: %{name}.service
Source2: %{name}.sysconfig
Source3: %{name}.init
-Patch0: format-security.patch
-Patch1: strncpy.patch
-Patch2: gcc10.patch
-Patch3: x32.patch
+Patch0: x32.patch
URL: https://tvheadend.org/projects/tvheadend
BuildRequires: avahi-devel
BuildRequires: dbus-devel
BuildRequires: gettext-tools
BuildRequires: libdvbcsa-devel
BuildRequires: openssl-devel
+BuildRequires: pcre2-8-devel
BuildRequires: pkgconfig
BuildRequires: python3-modules
BuildRequires: rpmbuild(macros) >= 1.647
DVB-C, DVB-T, ATSC, IPTV, and Analog video (V4L) as input sources.
%prep
-%setup -q
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
+%setup -q -n %{name}-%{gitref}
%ifarch x32
-%patch3 -p1
+%patch0 -p1
%endif
+%{__sed} -i -e '1s,/usr/bin/env python$,%{__python3},' lib/py/tvh/tv_meta_{tm,tv}db.py support/tvhmeta
+
%build
export CFLAGS="%{rpmcflags}"
export LDFLAGS="%{rpmldflags}"
--disable-dvbscan \
--disable-ffmpeg_static \
--disable-hdhomerun_static \
- --disable-libfdkaac_static \
- --disable-libmfx_static \
- --disable-libtheora_static \
- --disable-libvorbis_static \
- --disable-libvpx_static \
- --disable-libx264_static \
- --disable-libx265_static \
%{!?with_systemd:--disable-libsystemd_daemon}
%{__make} V=1