Skip to content

[backport][HLSTree] Fix manifest update thread spinning after a failed live update - #2108

Merged
CastagnaIT merged 1 commit into
xbmc:Omegafrom
CastagnaIT:fix_hls_update_omega
Aug 30, 2026
Merged

[backport][HLSTree] Fix manifest update thread spinning after a failed live update#2108
CastagnaIT merged 1 commit into
xbmc:Omegafrom
CastagnaIT:fix_hls_update_omega

Conversation

@CastagnaIT

Copy link
Copy Markdown
Collaborator

Description

bp #2098

Motivation and context

How has this been tested?

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • I have read the Contributing document
  • My code follows the Code Guidelines of this project
  • My change requires a change to the Wiki documentation
  • I have updated the documentation accordingly

When a live HLS manifest update failed, CHLSTree::OnUpdateSegments halved
m_updateInterval as a temporary backoff. On the second consecutive failure
the value being halved was the NO_VALUE sentinel that TreeUpdateThread
sets before each update, because a failed download never reaches the
parse that would replace it. NO_VALUE / 2 passes the worker loop guard
but overflows the ms-to-ns conversion in wait_for, so the wait returned
immediately and the thread issued manifest requests as fast as the
network allowed (measured at 350-450 per second against a 404 origin).

The sentinel reached the halving because m_resetInterval was set by
ResetInterval() and never cleared, so from the first failure on every
iteration wiped the interval before the parse.

- TreeUpdateThread clears m_resetInterval after applying it, so the
  reset happens once on the next update as documented
- TreeUpdateThread records m_lastValidUpdateInterval before clearing,
  skipping values a parser lowered as a backoff
- CHLSTree::OnUpdateSegments halves that recorded interval instead of
  m_updateInterval, with a lower bound so it cannot reach zero and stop
  the update thread

DASHTree and SmoothTree assign m_updateInterval directly and are not
affected.
@CastagnaIT CastagnaIT added Type: Fix non-breaking change which fixes an issue Type: Backport Component: HLS v21 Omega labels Aug 30, 2026
@CastagnaIT
CastagnaIT merged commit 6b9c6dd into xbmc:Omega Aug 30, 2026
7 checks passed
@CastagnaIT
CastagnaIT deleted the fix_hls_update_omega branch August 30, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: HLS Type: Backport Type: Fix non-breaking change which fixes an issue v21 Omega

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants