]> git.ipfire.org Git - thirdparty/tvheadend.git/commit
Improve the performance of updating the pid filter table in hdhomerun digital tuners.
authorNorm Raden <norm.raden+github@gmail.com>
Tue, 14 Sep 2021 15:28:08 +0000 (11:28 -0400)
committerFlole998 <Flole998@users.noreply.github.com>
Sun, 21 Nov 2021 13:00:54 +0000 (14:00 +0100)
commitb8710206eb073c72b142bce95846b77a0ffa34a6
tree4b77bc5ef9adf110c76d89da3a43e640071fe3f6
parent2efe90cdcf74fdc4179692d283cf46c85e1cf681
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).
src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c