Skip to content

Commit

Permalink
IPTV/HLS/M3U Playlist reload interval
Browse files Browse the repository at this point in the history
Compute the playlist reload interval as a fraction or a multiple
of the EXT-X-TARGETDURATION time. Usually this is 0.5 times the
target duration time, depending on download timing.
The logic for this has not changed, but due to a bug in the code
the result of the computation was always 0 seconds, resulting in
a reload interval time of 1 second independent of the target
duration. This bug is now fixed in this commit.

Refs #936
  • Loading branch information
kmdewaal committed Nov 29, 2024
1 parent e3fee61 commit a27a196
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mythtv/libs/libmythtv/recorders/HLS/HLSPlaylistWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,15 @@ void HLSPlaylistWorker::run(void)
// When should the playlist be reloaded
wakeup = m_parent->TargetDuration() > 0s ?
m_parent->TargetDuration() : 10s;
wakeup *= delay;

wakeup = std::chrono::milliseconds(static_cast<int>(delay * wakeup.count()));

if (wakeup > 60s)
wakeup = 60s;

LOG(VB_RECORD, LOG_DEBUG, LOC +
QString(" TargetDuration:%1s").arg(m_parent->TargetDuration().count()) +
QString(" wakeup:%1ms delay:%2").arg(wakeup.count()).arg(delay));
}

if (downloader)
Expand Down

0 comments on commit a27a196

Please sign in to comment.