Skip to content

VPAAMP-238 Fix ABR downswitch suppression during TSB live-edge playback#1398

Open
pstroffolino wants to merge 2 commits intodev_sprint_25_2from
feature/VPAAMP-238_A
Open

VPAAMP-238 Fix ABR downswitch suppression during TSB live-edge playback#1398
pstroffolino wants to merge 2 commits intodev_sprint_25_2from
feature/VPAAMP-238_A

Conversation

@pstroffolino
Copy link
Copy Markdown
Contributor

Reason for Change: When playing from local TSB at the live edge, GetBufferValue was overriding the actual GStreamer sink buffer depth with an inverse buffer signal (manifestEndDelta + liveOffset + fragmentDuration ~16.9s). ABRManager::GetDesiredProfileOnBuffer suppresses a 1-step rampdown when bufferValue > minBufferNeeded (3.9s), so every rampdown was blocked while the video sink starved.

Fix: save the actual sink depth (sinkBuffer) before computing the inverse buffer. When sinkBuffer < 2 x fragmentDuration (a critically-low sink), return sinkBuffer to ABR so the recommended rampdown is not suppressed.

…238)

When playing from local TSB at the live edge, GetBufferValue was overriding
the actual GStreamer sink buffer depth with an inverse buffer signal
(manifestEndDelta + liveOffset + fragmentDuration ~16.9s).
ABRManager::GetDesiredProfileOnBuffer suppresses a 1-step rampdown
when bufferValue > minBufferNeeded (3.9s), so every rampdown was blocked
while the video sink starved.

Fix: save the actual sink depth (sinkBuffer) before computing the inverse
buffer.  When sinkBuffer < 2 x fragmentDuration (a critically-low sink),
return sinkBuffer to ABR so the recommended rampdown is not suppressed.
@pstroffolino pstroffolino requested a review from a team as a code owner May 2, 2026 00:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes ABR ramp-down suppression during local TSB live-edge playback by ensuring ABR sees a “critically low” buffer signal (sink depth) instead of an inflated inverse-buffer calculation when the pipeline is close to starving.

Changes:

  • Preserve the pre-existing GetBufferedDuration() value as sinkBuffer before computing the inverse buffer signal.
  • Compute inverseBuffer from manifest end delta + live offset + fragment duration, with negative clamping.
  • When sinkBuffer falls below 2x fragmentDuration, return sinkBuffer to ABR instead of inverseBuffer to allow downswitching.

Comment thread streamabstraction.cpp
Comment on lines +2419 to +2421
AAMPLOG_WARN("Sink buffer (%.02lf)s below threshold (%.02lf)s during TSB live-edge; using sink depth for ABR instead of inverse buffer (%.02lf)s",
sinkBuffer, sinkLowThreshold, inverseBuffer);
bufferValue = sinkBuffer;
Comment thread streamabstraction.cpp
Comment on lines +2403 to 2404
const double sinkBuffer = bufferValue; /**< Actual GStreamer sink buffer depth */
double manifestEndDelta = tsbSessionManager->GetManifestEndDelta();
Comment thread streamabstraction.cpp
Comment on lines +2413 to 2426
const double sinkLowThreshold = 2.0 * track->fragmentDurationSeconds;
if(sinkBuffer < sinkLowThreshold)
{
/**< Sink is critically low; inverse buffer is an unreliable ABR signal.
* Use the actual GStreamer sink depth so ABR can downswitch before
* the pipeline starves (VPAAMP-238). */
AAMPLOG_WARN("Sink buffer (%.02lf)s below threshold (%.02lf)s during TSB live-edge; using sink depth for ABR instead of inverse buffer (%.02lf)s",
sinkBuffer, sinkLowThreshold, inverseBuffer);
bufferValue = sinkBuffer;
}
else
{
bufferValue = inverseBuffer;
}
Comment thread streamabstraction.cpp
Comment on lines +2413 to +2422
const double sinkLowThreshold = 2.0 * track->fragmentDurationSeconds;
if(sinkBuffer < sinkLowThreshold)
{
/**< Sink is critically low; inverse buffer is an unreliable ABR signal.
* Use the actual GStreamer sink depth so ABR can downswitch before
* the pipeline starves (VPAAMP-238). */
AAMPLOG_WARN("Sink buffer (%.02lf)s below threshold (%.02lf)s during TSB live-edge; using sink depth for ABR instead of inverse buffer (%.02lf)s",
sinkBuffer, sinkLowThreshold, inverseBuffer);
bufferValue = sinkBuffer;
}
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