Norm Raden [Tue, 10 May 2022 18:00:30 +0000 (14:00 -0400)]
Fixed and cleanup the "PSIP: ATSC Grabber" module (Fixes #5610)
- Bumped up limit on number of supported EIT/ETT tables from 5 to 256 (this is the max number of EIT/ETT tables in the ATSC specification)
- Remove table type 4 as a valid ETT table, there is no support for this table here and table type 4 doesn't supply any EPG data--just long names for channels/services, etc.
- Removed the very rapid toggling between mpegts_table_{add,destroy}(...) calls on EIT/ETT tables that caused continuous enabling/disabling of EIT and ETT PIDs.
- Added an 'ETM Location' check to EIT table handling to ensure that an event's extra text is cleared in the EPG database if there is no matching ETT.
- Removed epg_broadcast_change_finish(...) because it was erasing the extra text field in EPG database when updating title in EPG database (in EIT handler).
- Added the ability for receiving ETT tables with the same version ID. ETT tables use the same version ID for long runs of event IDs and 'Extra text's.
- Fix bug in retrieving the number of tables EIT/ETT tables listed in the MGT table.
- Removed the psip_{find,remove,add}_desc(...) functions (and supporting code) that stored ETT extra texts before
there was a matching EIT event and then would try to match up the ETT extra texts when the EIT event showed up.
However, the psip_*_desc(..) functions didn't keep track of the channel and would match up the ETT 'Extra text' with the wrong EIT event.
- Removed some non-functional code.
- Removed old commented out test code.
- Added placeholder support for 'stop' and 'done' functions of this module for future development.
The "Over-the-air: PSIP: ATSC Grabber" module now quickly and correctly populates 'Title', 'Extra text', 'Start time', 'End time', 'Duration', etc... fields in the EPG Database.
Building Tvheadend on Raspberry Pi with gcc 12 fails with this error
src/misc/json.c: In function ‘json_parse_string’:
src/misc/json.c:120:31: error: pointer ‘r’ used after ‘free’ [-Werror=use-after-free]
120 | *failp = (a - r) + start;
| ~~~^~~~
src/misc/json.c:118:19: note: call to ‘free’ here
118 | free(r);
| ^~~~~~~
This PR appears correct and fixes the gcc error but has not been tested as it is an error path.
Nita Vesa [Wed, 23 Feb 2022 19:45:52 +0000 (21:45 +0200)]
Always parse 'src' in RTSP-requests
Originally, the code did not parse 'src' in RTSP-requests for
DVB-C tuners. This patch moves to always parse the parameter,
allowing e.g. Plex and possibly other SAT>IP-clients to work.
Ovaron [Mon, 21 Mar 2022 18:47:08 +0000 (19:47 +0100)]
Update for VAAPI transcoding
VAAPI: Buffer factor (buffersize manipulation) now configurable at WebUI.
VAAPI: Added rc_mode (h264/hevc) and tier (hevc), both configurable via WebUI.
VAAPI: Removed B-Frame workaround from the past at HEVC.
VAAPI: Added an option for ignore b-frames because some drivers needs this (AMD).
VAAPI: Also updated VP8 and VP9 encoding.
VAAPI: VP8 and VP9 now also reacts on options for "Buffer factor" and "Ignore B-Frames" and got the "force_key_frames" expression to increase picture quality.
VAAPI: Added destroy option for h264 codec (might have created memory issues)
Ovaron [Thu, 10 Feb 2022 20:51:21 +0000 (21:51 +0100)]
Update buffer size for h264 and hevc
Increased buffer for h264 and hevc transcoding (from ((self->bit_rate) * 1000) * 2 to ((self->bit_rate) * 1000) * 3).
With bigger buffer picture creates less artefacts on lower bitrates.
Jacek Tomasiak [Sat, 5 Feb 2022 00:03:44 +0000 (01:03 +0100)]
httpc: Fix multi-value "Connection" header checks
Connection header was checked for exact "close" or "upgrade" values
while it could contain multiple values delimited with commas.
New function was added for checking such cases.
Code is based on kv_find_value() function from:
https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/relayd/relayd.c
Commit 0165f365cd58bbcc3734e4ec9ce696b42870ff8e introduced an FTBFS
when -Werror=int-conversion is passed to the compiler. For
reasons unknown to me, the "value" argument to AV_DICT_SET_INT was
written as a string (const char *) rather than the int64_t that
the function behind the macro was expecting in the "Set Defaults"
statements. This was resulting in the value of the pointer to the
character array getting used as the argument rather than the
integer itself, which appears to be what was intended. This
triggers the Werror=int-conversion error and also probably results
in unexpected behavior from passing the pointer values.
Michael Marley [Sun, 2 Jan 2022 17:38:17 +0000 (12:38 -0500)]
nvenc: Fix Werror=misleading-indentation FTBFS
Commit 0165f365cd58bbcc3734e4ec9ce696b42870ff8e introduced an FTBFS
when -Werror=misleading-indentation is passed to the compiler. It
appears from changes elsewhere in the file (around line 450) that
the "Set Defaults" statements were not intended to be included in
the if block, so this commit reformats it to make that obvious (and
also add curlybrackets as was done around 450.)
Michael Marley [Sun, 12 Dec 2021 02:01:08 +0000 (21:01 -0500)]
iptv: Fix stream limit starting a new input on a running mux
In iptv.c:iptv_input_is_free(), if all the conf arguments are 0
(when called from input_is_enabled()), return null if the mux
associated with the input is already running. If the mux is
already running, starting a new input on it isn't going to create
a new input stream or break any bandwidth limit. This fixes an
issue where starting a new channel/input on a mux that is already
active when the maximum number of input streams are in use would
result in failure.
This function is rather dense and appears to perform multiple
different functions depending on who called it, so I had a hard
time understanding exactly what is going on. Therefore, I made
this patch in a way to be sure that it wouldn't affect how it works
in other cases than input_is_enabled(). If there is a better way
to do this, please do tell me.
Michael Marley [Sat, 11 Dec 2021 23:09:47 +0000 (18:09 -0500)]
Use clock_gettime() instead of time() in epggrab.c
time() appears to return a slightly-rounded value as compared to
functions that return higher-precision time like gettimeofday() and
timespec_get(). Specifically, when gettimeofday() would return a
value with a low number in tv_usec, time() will return one fewer
seconds than tv_sec from gettimeofday(). The difference is minute
and probably doesn't cause an issue in most cases, but here in
epggrab.c the time of the next cron run is calculated immediately
after the previous run fires. In this case, the value of time()
is actually one second lower than the specified cron run time. This
value is then passed into cron_multi_next(), which correctly sets
the next cron run to the current time. Therefore, as soon as the
EPG grab completes, cron triggers again and re-runs it. Using the
more precise values from gettimeofday() (by way of clock_gettime())
solves this problem and ensures that cron runs only once.
Norm Raden [Tue, 14 Sep 2021 15:28:08 +0000 (11:28 -0400)]
Improve the performance of updating the pid filter table in hdhomerun digital tuners.
- Construct the compact list of pids formatted for the hdhomerun and handle edge cases.
- For each call to tvhdhomerun_frontend_update_pids(...), only issue one set_tuner_filter call to the hdhomerun.
- Turn off pids when done using them.
- Handle the rare case where the requested list of pids does not fit in to the fixed length buffer by enabling all pids, excluding the NULL pid.
Previously, calls to update the pids would generate get_tuner_filter and set_tuner_filter calls for each individual pid.
Also, while a tuner was allocated, pids would never be freed up from the hdhomerun filter table even when they were no longer needed.
And if the list of requested pids had exceeded the fixed length buffer, then not all the requested pids would be properly enabled.
Very noticeably, in cases where the number of pids is large enough, very frequent pid updates would overload the hdhomerun causing it to
drop bursts of program data (mpegts broadcast packets) every several seconds on all tuners for the duration of the rapid pid updates
(reproducible on the HDHR4-2US model).
James Hutchinson [Tue, 19 Oct 2021 14:35:27 +0000 (15:35 +0100)]
opentv: fix missing summary data on rescrape, #5995
Chunks of events within the OpenTV data can contain blank summaries
following a re-scrape.
The issue of blank summary data occurs when the event in question
already exists in the guide, and upon rescrape the summary record for
the event in question is procesed before the title record.
In this scenario we should merge the data to avoid blanking out the
summary data.
James Hutchinson [Sun, 26 Sep 2021 18:30:40 +0000 (19:30 +0100)]
opentv: fix incorrect summaries for skyuk epg, fixes #5995
Events within the OpenTV SkyUK data can contain the same Event ID as
another event on a different channel.
This resulted in missing or incorrect summary data, since matching was
based solely on the Event ID.
This commit adjusts the opentv _entry_cmp function to match based on a
combination of Event ID and Channel ID. This enables the RB_FIND &
RB_INSERT_SORTED functions used within the OpenTV module to reliably
insert and uniquely find the correct entry.
Autobuild: Add arm64, armhf and armel for bullseye and buster.
This is mainly for building packages on the Pi running plain-ol Debian and not Raspbian/Raspberry Pi OS, images are available at https://raspi.debian.net.
spdfrk [Sat, 13 Jun 2020 14:26:30 +0000 (16:26 +0200)]
iptv: new features for multicast, rtsp & rtcp
- Implement RTCP Negative Acknowledge (a.k.a. Retransmission) support for RTP streams.
When packet loss is detected the client will send a RTCP Generic Feedback report to the server. The server can than resend these lost packets.
Retransmitted packets are send through a second connection or as part of the main stream, both cases are supported.
For Multicast manual setup of the RTCP server is required, for RTSP automatic setup (was already implemented for Receiver Reports) or manual override is possible.
- General clean-up of unused RTCP code and restructure to allow for easy implementation of different types of RTCP messages.
- Make RTCP Receiver Reports optional.
- RTSP start session with DESCRIBE and parse response content.
- RTSP DESCRIBE redirect support.
- Parse DESCRIBE response for AVPF support (required for Retransmission).
- Implement remote time shift support for RTSP streams.
This option can be enabled for a channel to pass-through time shift commands to the RTSP server, the internal time shift buffer is then disabled.