VPAAMP-238 Fix ABR downswitch suppression during TSB live-edge playback#1398
Open
pstroffolino wants to merge 2 commits intodev_sprint_25_2from
Open
VPAAMP-238 Fix ABR downswitch suppression during TSB live-edge playback#1398pstroffolino wants to merge 2 commits intodev_sprint_25_2from
pstroffolino wants to merge 2 commits intodev_sprint_25_2from
Conversation
…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.
Contributor
There was a problem hiding this comment.
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 assinkBufferbefore computing the inverse buffer signal. - Compute
inverseBufferfrom manifest end delta + live offset + fragment duration, with negative clamping. - When
sinkBufferfalls below2x fragmentDuration, returnsinkBufferto ABR instead ofinverseBufferto allow downswitching.
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 on lines
+2403
to
2404
| const double sinkBuffer = bufferValue; /**< Actual GStreamer sink buffer depth */ | ||
| double manifestEndDelta = tsbSessionManager->GetManifestEndDelta(); |
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 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; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.