Skip to content

Commit

Permalink
Closes #164: Allow jumping back in time to lower HLS segments
Browse files Browse the repository at this point in the history
  • Loading branch information
nschlia committed Sep 22, 2024
1 parent 754655c commit 6223a19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ffmpeg_transcoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5535,7 +5535,8 @@ int FFmpeg_Transcoder::start_new_segment()
// No check if m_segment_duration == 0, values <= 0 not accepted
// Cast is OK here, the result will always be small enough for an int32.
uint32_t min_seek_segments = static_cast<uint32_t>(params.m_min_seek_time_diff / params.m_segment_duration);
if (min_seek_segments && next_segment + min_seek_segments >= segment_no)

if (min_seek_segments && segment_no >= next_segment && segment_no <= next_segment + min_seek_segments)
{
Logging::info(virtname(), "Discarding seek request to HLS segment no. %1, less than %2 seconds (%3 segments) away.", segment_no, params.m_min_seek_time_diff / AV_TIME_BASE, min_seek_segments);
continue;
Expand Down

0 comments on commit 6223a19

Please sign in to comment.