Skip to content

Fix TTFB bandwidth allocation for zero-duration chunks - #3551

Open
krocard wants to merge 2 commits into
androidx:mainfrom
krocard:codex/upstream-preload-zero-duration
Open

krocard wants to merge 2 commits into
androidx:mainfrom
krocard:codex/upstream-preload-zero-duration

Conversation

@krocard

@krocard krocard commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

LL-HLS preload hints expose a zero chunk duration to ABR. When a TTFB estimate is available, this can produce a zero bandwidth budget and select the lowest quality despite ample bandwidth.

Preload transfers are already excluded from bandwidth and TTFB measurements. ABR still uses estimates learned from previous media requests to select the next rendition. The problem is applying the duration-dependent TTFB adjustment when that next chunk’s duration is unknown.

Details

  • Problem: For a zero-duration chunk, the TTFB adjustment divides a zero loading window by zero. The resulting NaN becomes a zero bandwidth budget.
  • Example: With official Media3 1.10.1 on this LL-HLS stream, a preload hint produced a zero budget despite a 66.6 Mbps estimate, selecting 700.7 kbps after a previous selection of 4.71 Mbps.
  • Solution: Skip the TTFB adjustment when the chunk duration is zero or unknown, using the existing bandwidth/playback-speed fallback. Positive durations retain the TTFB adjustment.

@krocard
krocard marked this pull request as ready for review November 15, 2026 08:47
@tonihei

tonihei commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the issue, we'll have a look and import the PR as needed.

@tonihei
tonihei force-pushed the codex/upstream-preload-zero-duration branch from e501227 to 7b8fbb2 Compare December 1, 2026 11:11
@tonihei
tonihei force-pushed the codex/upstream-preload-zero-duration branch from 7b8fbb2 to 0c2a30c Compare December 1, 2026 15:58
@tonihei
tonihei force-pushed the codex/upstream-preload-zero-duration branch from 0c2a30c to 52eb156 Compare December 1, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants