VPAAMP-857:False underflow fired after seek+fragment-retry - #1783
VPAAMP-857:False underflow fired after seek+fragment-retry#1783varshnie wants to merge 2 commits into
Conversation
Reason for change:GStreamer reports a stale pre-seek position during seek+fragment-retry,causing NotifyVideoFragment to compute negative bufferSec which triggered an immediate false underflow. Fixed by disarming on negative bufferSec and passing 0.0f rate when pipeline is intentionally paused. Risks: p1 Signed-off-by: varshnie <varshniblue14@gmail.com>
There was a problem hiding this comment.
Pull request overview
Fixes a false video underflow being raised after seek + fragment-retry by making the underflow monitor treat “impossible” negative buffer depth as a stale GStreamer position and by explicitly disarming deadlines when the pipeline is intentionally paused.
Changes:
- Pass
playRate=0.0fto the underflow monitor when the sink is intentionally paused, so the monitor disarms instead of arming. - In
AampUnderflowMonitor::NotifyVideoFragment, disarm (instead of clamping) when computedbufferSecis negative to avoid immediate false underflow. - On user pause (
SetRateInternal(rate==0)), notify the underflow monitor that the pipeline is paused so deadlines are disarmed.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| MediaStreamContext.cpp | Adjusts NotifyVideoFragmentToUnderflowMonitor() call sites to pass 0-rate while paused. |
| main_aamp.cpp | Disarms underflow monitoring when the user pauses the pipeline. |
| AampUnderflowMonitor.cpp | Treats negative bufferSec as stale position and disarms the deadline. |
Comments suppressed due to low confidence (1)
MediaStreamContext.cpp:760
- Same issue as the earlier LL-DASH chunk path:
mSinkPausedis true during buffering underflow as well as user pause, andNotifyVideoFragment()needs a non-zeroplayRateduring underflow recovery so it can rearm the deadline after it resumes the pipeline.
// aamp->rate is the last non-zero rate and stays 1.0 even when paused.
// Pass 0.0f when mSinkPaused so RearmDeadline disarms instead of arming.
context->NotifyVideoFragmentToUnderflowMonitor(
dlInfo->absolutePosition + dlInfo->fragmentDurationSec,
aamp->mSinkPaused.load() ? 0.0f : aamp->rate);
| // download retry is in progress and GStreamer hasn't flushed yet). Disarm | ||
| // the deadline rather than clamping to 0, which would trigger an immediate | ||
| // false underflow. | ||
| if (bufferSec < 0.0) |
There was a problem hiding this comment.
Lets wait for @pstroffolino review comment.
Current behavior -> if bogus position received from GStreamer, bufferSec drops negative and underflow is fired
Impact -> While receiving bogus position, underflow monitor is disarmed, thus not impacting playback as well as losing underflow detection
245aa61 to
ad24ebe
Compare
Reason for change:GStreamer reports a stale pre-seek position during seek+fragment-retry,causing NotifyVideoFragment to compute negative bufferSec which triggered an immediate false underflow. Fixed by disarming on negative bufferSec and passing 0.0f rate when pipeline is intentionally paused. Risks: p1 Signed-off-by: varshnie <varshniblue14@gmail.com>
ad24ebe to
c2d818f
Compare
| // false underflow. | ||
| if (bufferSec < 0.0) | ||
| { | ||
| AAMPLOG_WARN("[video] negative bufferSec=%.3f (endPos=%.3f positionSec=%.3f) — stale GSTpos; disarming deadline", |
| // paused by the user. This disarms the deadline so that fragments | ||
| // downloaded while paused (e.g. during seek-while-paused) do not | ||
| // trigger a false underflow via NotifyVideoFragment. | ||
| if (aamp->mpStreamAbstractionAAMP) |
There was a problem hiding this comment.
Check for retVal before calling NotifyPipelinePausedToUnderflowMonitor, will help plug any issues if pipeline didn't pause
Reason for change:GStreamer reports a stale pre-seek position during seek+fragment-retry,causing NotifyVideoFragment to compute negative bufferSec which triggered an immediate false underflow. Fixed by disarming on negative bufferSec and passing 0.0f rate when pipeline is intentionally paused. Risks: p1