Repository navigation
media: Report seek time from StarboardRenderer until SbPlayer presents - #13721
Merged
andrewsavage1 merged 2 commits intoNov 3, 2026
Merged
Conversation
Contributor
|
Contributor
🤖 Gemini Suggested Commit Message💡 Pro Tips for a Better Commit Message:
|
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to prevent the media pipeline from clamping and freezing the media time during asynchronous seeks. It does this by reporting the target seek time from GetMediaTime() until the player transitions to a presenting or end-of-stream state, accompanied by a new unit test. The review feedback recommends resetting the is_seek_pending_presenting_ flag during a Flush() operation to avoid returning stale seek times, and suggests limiting the VLOG_IF statement in GetMediaTime() to log only once per seek to prevent log spam.
kjyoun
reviewed
Oct 29, 2026
borongc
reviewed
Oct 30, 2026
borongc
reviewed
Oct 30, 2026
andrewsavage1
force-pushed
the
fix-seek-stale-media-time
branch
from
November 3, 2026 01:04
f2c696e to
d765f4e
Compare
kjyoun
approved these changes
Nov 3, 2026
borongc
reviewed
Nov 3, 2026
borongc
approved these changes
Nov 3, 2026
After StartPlayingFrom() calls SbPlayerSeek(), SbPlayerGetInfo() may keep returning the pre-seek position until the platform completes the seek asynchronously. PipelineImpl only substitutes the seek time until OnSeekDone, which is posted right after StartPlayingFrom(), and afterwards clamps media time so that it never goes backwards. A stale pre-seek value therefore latches into PipelineImpl::last_media_time_, freezing currentTime after a backwards seek for the length of the seek. The web app then shows buffering and eventually reloads the player. Cobalt 25's SbPlayerPipeline::GetMediaTime() returned the seek time until the SbPlayer reached kSbPlayerStatePresenting. Restore that behavior in StarboardRenderer. Verified on a 2027 Samsung Tizen TV: seeking back 20s while playing froze currentTime for ~20s before the change and resumes immediately after it. RDK is unaffected as its SbPlayerSeek() records the seek target synchronously. Added StarboardRendererTest.GetMediaTimeReportsSeekTimeUntilPresenting, which fails without this change. Bug: 575365692 TAG=agy CONV=95eeeebe-e64a-4dba-b215-21568808834d
- Use buffering_state_ == BUFFERING_HAVE_NOTHING instead of a separate is_seek_pending_presenting_ flag. - Remove redundant seek_time_ assignment in StartPlayingFrom(). - Drop per-call VLOG in GetMediaTime(). - Add StarboardRendererTest.GetMediaTimeReportsSeekTimeAfterBackwardSeek. Bug: 575365692
andrewsavage1
force-pushed
the
fix-seek-stale-media-time
branch
from
November 3, 2026 21:23
d765f4e to
13d6414
Compare
cobalt-github-releaser-bot
pushed a commit
that referenced
this pull request
Nov 3, 2026
… until SbPlayer presents Refer to original PR: #13721 After `StartPlayingFrom()` calls `SbPlayerSeek()`, `SbPlayerGetInfo()` may keep returning the pre-seek position until the platform completes the seek asynchronously. `PipelineImpl` only substitutes the seek time until `OnSeekDone`, which is posted right after `StartPlayingFrom()`, and afterwards clamps media time so that it never goes backwards. A stale pre-seek value therefore latches into `PipelineImpl::last_media_time_`, freezing `currentTime` after a backwards seek for the length of the seek. The web app then shows buffering and eventually reloads the player. Cobalt 25's `SbPlayerPipeline::GetMediaTime()` returned the seek time until the SbPlayer reached `kSbPlayerStatePresenting`. This restores that behavior in `StarboardRenderer`: while `buffering_state_` is `BUFFERING_HAVE_NOTHING` (from construction or `Flush()` until the SbPlayer reaches `kSbPlayerStatePresenting`), `GetMediaTime()` reports `seek_time_`. Testing: - Device with an asynchronous SbPlayerSeek() implementation (27.lts build): seeking back 20s while playing froze `currentTime` for ~20s before the change (logs show `SbPlayerGetInfo()` returning 41.39s right after `StartPlayingFrom(21.38s)`), and resumes from the seek target immediately after it. Forward seeks into unbuffered ranges and back-to-back seeks also behave normally. - RDK: not affected before or after, as its `SbPlayerSeek()` records the seek target synchronously. - Added `StarboardRendererTest.GetMediaTimeReportsSeekTimeUntilPresenting` and `StarboardRendererTest.GetMediaTimeReportsSeekTimeAfterBackwardSeek`, which fail without this change (reporting the pre-seek time instead of 20s). `StarboardRendererTest.*` and `SbPlayerBridge*` pass on linux-x64x11 devel. Bug: 575365692 TAG=agy CONV=95eeeebe-e64a-4dba-b215-21568808834d (cherry picked from commit 0fa4078)
kjyoun
added a commit
to kjyoun/cobalt
that referenced
this pull request
Nov 3, 2026
SbPlayer has no rebuffering state. When one stream runs out of data
mid-playback while the other is still buffered (e.g. video starves
while audio is buffered), the media clock keeps advancing on the
remaining stream. StarboardRenderer reported BUFFERING_HAVE_ENOUGH on
kSbPlayerStatePresenting and BUFFERING_HAVE_NOTHING only on Flush(), so
such an underflow was never surfaced: readyState stayed
HAVE_ENOUGH_DATA, no 'waiting' event fired, currentTime kept advancing,
and web apps could not detect the stall. On YouTube this shows up as
frozen video with audio playing and no rebuffering spinner after
switching to a format the network can't sustain (b/578446041).
Behind the new Media.HandlePlaybackUnderflow experimental feature (an
h5vcc setting, off by default):
- PlaybackUnderflowDetector (new) is a pure state machine over the data
written to the SbPlayer per stream:
- A stream is starved when less than 100 ms of written data is left
ahead of the media time while it waits on the demuxer. The margin
covers platforms whose clock stops slightly early (e.g. Starboard's
audio renderer on audio starvation).
- Audio starvation, or video starvation without audio, starts an
underflow right away. Video-only starvation while audio has data is
tolerated for 3 s first, like RendererImpl's video underflow
threshold (crbug.com/144683).
- An underflow ends when every stream has 500 ms of written data
ahead, has written end of stream, or has had no read pending for 1 s
while having data ahead (the pipeline is full and can't hold 500 ms,
so it would otherwise never resume).
- PlaybackUnderflowHandler (new) is an interface created with
PlaybackUnderflowHandler::Create(enabled, ...). When enabled, the
implementation polls the detector every 100 ms while presenting and
acts through a Delegate: on underflow it pauses the SbPlayer (stopping
the media clock) and reports BUFFERING_HAVE_NOTHING with
DEMUXER_UNDERFLOW; on recovery it resumes the SbPlayer at the app's
playback rate and reports BUFFERING_HAVE_ENOUGH. While paused for
underflow, app rate changes are held and applied on resume, and a user
pause keeps the SbPlayer paused. If the SbPlayer presents again during
an underflow (e.g. after being recreated), the underflow is cleared and
the app's rate restored. When disabled, a null implementation does
nothing, so the renderer needs no feature checks.
- StarboardRenderer forwards lifecycle events (start, presenting, end
of stream, flush, written buffers) to the handler and skips applying
rate changes while IsPausedForUnderflow(). The Delegate is
implemented by StarboardRenderer::UnderflowDelegate, a nested class
defined in starboard_renderer.cc. A new
OnBufferingStateChangeWithReason() passes the reason; existing callers
of OnBufferingStateChange() are unchanged. URL players (tvOS) are not
monitored, as their data doesn't go through the demuxer.
GetMediaTime() keeps reporting the SbPlayer position while paused for
underflow, rather than the seek time it reports for other
BUFFERING_HAVE_NOTHING periods (youtube#13721).
Enable for testing with:
--enable-h5vcc-settings=Media.HandlePlaybackUnderflow=1
Bug: 578446041
Change-Id: I939a789a6e39651dd87c871a6e473b2328ca3e18
kjyoun
added a commit
to kjyoun/cobalt
that referenced
this pull request
Nov 4, 2026
SbPlayer has no rebuffering state. When one stream runs out of data
mid-playback while the other is still buffered (e.g. video starves
while audio is buffered), the media clock keeps advancing on the
remaining stream. StarboardRenderer reported BUFFERING_HAVE_ENOUGH on
kSbPlayerStatePresenting and BUFFERING_HAVE_NOTHING only on Flush(), so
such an underflow was never surfaced: readyState stayed
HAVE_ENOUGH_DATA, no 'waiting' event fired, currentTime kept advancing,
and web apps could not detect the stall. On YouTube this shows up as
frozen video with audio playing and no rebuffering spinner after
switching to a format the network can't sustain (b/578446041).
Behind the new Media.HandlePlaybackUnderflow experimental feature (an
h5vcc setting, off by default):
- PlaybackUnderflowDetector (new) is a pure state machine over the data
written to the SbPlayer per stream:
- A stream is starved when less than 100 ms of written data is left
ahead of the media time while it waits on the demuxer. The margin
covers platforms whose clock stops slightly early (e.g. Starboard's
audio renderer on audio starvation).
- Audio starvation, or video starvation without audio, starts an
underflow right away. Video-only starvation while audio has data
ahead (even after audio end of stream is written) is tolerated for
3 s first, like RendererImpl's video underflow threshold
(crbug.com/144683). The delay is only cancelled once video
has caught up (100 ms ahead), or while playback isn't checked (e.g.
paused by the app), so a trickle of video data can't postpone it.
- An underflow ends when every stream has 500 ms of written data
ahead, has written end of stream, or is saturated: no read pending
and nothing written for 1 s, i.e. the SbPlayer stopped asking for
data (the pipeline is full and can't hold 500 ms, so it would
otherwise never resume).
- PlaybackUnderflowHandler (new) is an interface created with
PlaybackUnderflowHandler::Create(enabled, ...). When enabled, the
implementation polls the detector every 100 ms while presenting and
acts through a Delegate: on underflow it pauses the SbPlayer (stopping
the media clock) and reports BUFFERING_HAVE_NOTHING with
DEMUXER_UNDERFLOW; on recovery it resumes the SbPlayer at the app's
playback rate and reports BUFFERING_HAVE_ENOUGH. While paused for
underflow, app rate changes are held and applied on resume, and a user
pause keeps the SbPlayer paused. Defensively, if the SbPlayer presents
again during an underflow (e.g. if it is ever re-prerolled without a
Flush()) or reaches end of stream during an underflow, the underflow
is cleared and the app's rate restored. When disabled, a null
implementation does nothing, so the renderer needs no feature checks.
- StarboardRenderer forwards lifecycle events (start, presenting, end
of stream, flush, written buffers) to the handler and skips applying
rate changes while IsPausedForUnderflow(). The Delegate is
implemented by StarboardRenderer::UnderflowDelegate, a nested class
defined in starboard_renderer.cc. A new
OnBufferingStateChangeWithReason() passes the reason; existing callers
of OnBufferingStateChange() are unchanged. URL players (tvOS) are not
monitored, as their data doesn't go through the demuxer.
GetMediaTime() keeps reporting the SbPlayer position while paused for
underflow, rather than the seek time it reports for other
BUFFERING_HAVE_NOTHING periods (youtube#13721).
Enable for testing with:
--enable-h5vcc-settings=Media.HandlePlaybackUnderflow=1
Bug: 578446041
Change-Id: I6cff893f1da915d936579351b1b772c1f54bb822
kjyoun
added a commit
to kjyoun/cobalt
that referenced
this pull request
Nov 4, 2026
SbPlayer has no rebuffering state. When one stream runs out of data
mid-playback while the other is still buffered (e.g. video starves
while audio is buffered), the media clock keeps advancing on the
remaining stream. StarboardRenderer reported BUFFERING_HAVE_ENOUGH on
kSbPlayerStatePresenting and BUFFERING_HAVE_NOTHING only on Flush(), so
such an underflow was never surfaced: readyState stayed
HAVE_ENOUGH_DATA, no 'waiting' event fired, currentTime kept advancing,
and web apps could not detect the stall. On YouTube this shows up as
frozen video with audio playing and no rebuffering spinner after
switching to a format the network can't sustain (b/578446041).
Behind the new Media.HandlePlaybackUnderflow experimental feature (an
h5vcc setting, off by default):
- PlaybackUnderflowDetector (new) is a pure state machine over the data
written to the SbPlayer per stream:
- A stream is starved when less than 100 ms of written data is left
ahead of the media time while it waits on the demuxer. The margin
covers platforms whose clock stops slightly early (e.g. Starboard's
audio renderer on audio starvation).
- Audio starvation, or video starvation without audio, starts an
underflow right away. Video-only starvation while audio has data
ahead (even after audio end of stream is written) is tolerated for
3 s first, like RendererImpl's video underflow threshold
(crbug.com/144683). The delay is only cancelled once video
has caught up (100 ms ahead), or while playback isn't checked (e.g.
paused by the app), so a trickle of video data can't postpone it.
- An underflow ends when every stream has 500 ms of written data
ahead, has written end of stream, or is saturated: no read pending
and nothing written for 1 s, i.e. the SbPlayer stopped asking for
data (the pipeline is full and can't hold 500 ms, so it would
otherwise never resume).
- PlaybackUnderflowHandler (new) is an interface created with
PlaybackUnderflowHandler::Create(enabled, ...). When enabled, the
implementation polls the detector every 100 ms while presenting and
acts through a Delegate: on underflow it pauses the SbPlayer (stopping
the media clock) and reports BUFFERING_HAVE_NOTHING with
DEMUXER_UNDERFLOW; on recovery it resumes the SbPlayer at the app's
playback rate and reports BUFFERING_HAVE_ENOUGH. While paused for
underflow, app rate changes are held and applied on resume, and a user
pause keeps the SbPlayer paused. Defensively, if the SbPlayer presents
again during an underflow (e.g. if it is ever re-prerolled without a
Flush()) or reaches end of stream during an underflow, the underflow
is cleared and the app's rate restored. When disabled, a null
implementation does nothing, so the renderer needs no feature checks.
- StarboardRenderer forwards lifecycle events (start, presenting, end
of stream, flush, written buffers) to the handler and skips applying
rate changes while IsPausedForUnderflow(). The Delegate is
implemented by StarboardRenderer::UnderflowDelegate, a nested class
defined in starboard_renderer.cc. A new
OnBufferingStateChangeWithReason() passes the reason; existing callers
of OnBufferingStateChange() are unchanged. URL players (tvOS) are not
monitored, as their data doesn't go through the demuxer.
GetMediaTime() keeps reporting the SbPlayer position while paused for
underflow, rather than the seek time it reports for other
BUFFERING_HAVE_NOTHING periods (youtube#13721).
Enable for testing with:
--enable-h5vcc-settings=Media.HandlePlaybackUnderflow=1
Bug: 578446041
Change-Id: I6cff893f1da915d936579351b1b772c1f54bb822
This was referenced Nov 4, 2026
cobalt-github-releaser-bot
pushed a commit
that referenced
this pull request
Nov 23, 2026
… until SbPlayer presents Refer to original PR: #13721 After `StartPlayingFrom()` calls `SbPlayerSeek()`, `SbPlayerGetInfo()` may keep returning the pre-seek position until the platform completes the seek asynchronously. `PipelineImpl` only substitutes the seek time until `OnSeekDone`, which is posted right after `StartPlayingFrom()`, and afterwards clamps media time so that it never goes backwards. A stale pre-seek value therefore latches into `PipelineImpl::last_media_time_`, freezing `currentTime` after a backwards seek for the length of the seek. The web app then shows buffering and eventually reloads the player. Cobalt 25's `SbPlayerPipeline::GetMediaTime()` returned the seek time until the SbPlayer reached `kSbPlayerStatePresenting`. This restores that behavior in `StarboardRenderer`: while `buffering_state_` is `BUFFERING_HAVE_NOTHING` (from construction or `Flush()` until the SbPlayer reaches `kSbPlayerStatePresenting`), `GetMediaTime()` reports `seek_time_`. Testing: - Device with an asynchronous SbPlayerSeek() implementation (27.lts build): seeking back 20s while playing froze `currentTime` for ~20s before the change (logs show `SbPlayerGetInfo()` returning 41.39s right after `StartPlayingFrom(21.38s)`), and resumes from the seek target immediately after it. Forward seeks into unbuffered ranges and back-to-back seeks also behave normally. - RDK: not affected before or after, as its `SbPlayerSeek()` records the seek target synchronously. - Added `StarboardRendererTest.GetMediaTimeReportsSeekTimeUntilPresenting` and `StarboardRendererTest.GetMediaTimeReportsSeekTimeAfterBackwardSeek`, which fail without this change (reporting the pre-seek time instead of 20s). `StarboardRendererTest.*` and `SbPlayerBridge*` pass on linux-x64x11 devel. Bug: 575365692 TAG=agy CONV=95eeeebe-e64a-4dba-b215-21568808834d (cherry picked from commit 0fa4078)
andrewsavage1
added a commit
that referenced
this pull request
Nov 23, 2026
Fixes for rolled commits that build on main but break against staging's newer Chromium base: - third_party/icu/scripts/generate_cobalt_icudata.py (#12800): build the ICU host tools as ICU clients. Since ICU 77, the U_*_IMPLEMENTATION defines move header-only helpers such as icu::toUCharPtr() into icu::internal, so genrb failed to compile with staging's ICU 78: reslist.h:329:48: error: no member named 'toUCharPtr' in namespace 'icu_78' - cobalt/android/cobalt_process_state_summary_jni.cc (#12616): add DEFINE_JNI(CobaltProcessStateSummary). Staging's jni_zero requires it for classes with natives. Without it, Android fails with -Wunused-function on the JNI_ functions, and AOSP fails to link with undefined Muxed_dev_cobalt_coat_CobaltProcessStateSummary_* symbols. - media/starboard/sbplayer_bridge_test.cc (#13807), media/starboard/starboard_renderer_unittest.cc (#13721, #13807) and cobalt/app/app_event_delegate_unittest.cc: pass the lambdas directly to WillOnce()/WillRepeatedly() instead of wrapping them in the deprecated testing::Invoke() (-Werror,-Wdeprecated-declarations). - third_party/blink/renderer/modules/cobalt/h5vcc_system/h_5_vcc_system.cc (#13593): use BindOnce instead of WTF::BindOnce, since staging's Blink no longer has the WTF namespace. Bug: 574599290 TAG=agy CONV=2c5cf2b4-5ccb-4755-8885-0e4970a60804
andrewsavage1
added a commit
that referenced
this pull request
Nov 24, 2026
Fixes for rolled commits that build on main but break against staging's newer Chromium base: - third_party/icu/scripts/generate_cobalt_icudata.py (#12800): build the ICU host tools as ICU clients. Since ICU 77, the U_*_IMPLEMENTATION defines move header-only helpers such as icu::toUCharPtr() into icu::internal, so genrb failed to compile with staging's ICU 78: reslist.h:329:48: error: no member named 'toUCharPtr' in namespace 'icu_78' - cobalt/android/cobalt_process_state_summary_jni.cc (#12616): add DEFINE_JNI(CobaltProcessStateSummary). Staging's jni_zero requires it for classes with natives. Without it, Android fails with -Wunused-function on the JNI_ functions, and AOSP fails to link with undefined Muxed_dev_cobalt_coat_CobaltProcessStateSummary_* symbols. - media/starboard/sbplayer_bridge_test.cc (#13807), media/starboard/starboard_renderer_unittest.cc (#13721, #13807) and cobalt/app/app_event_delegate_unittest.cc: pass the lambdas directly to WillOnce()/WillRepeatedly() instead of wrapping them in the deprecated testing::Invoke() (-Werror,-Wdeprecated-declarations). - third_party/blink/renderer/modules/cobalt/h5vcc_system/h_5_vcc_system.cc (#13593): use BindOnce instead of WTF::BindOnce, since staging's Blink no longer has the WTF namespace. - cobalt/browser/h5vcc_system/h5vcc_system_impl_android.cc and cobalt/browser/h5vcc_system_browsertest.cc (#13593): use base::android::android_info::sdk_int()/SDK_VERSION_R. Staging's base no longer has base/android/build_info.h. Bug: 574599290 TAG=agy CONV=2c5cf2b4-5ccb-4755-8885-0e4970a60804
cobalt-roller-and-merger Bot
pushed a commit
that referenced
this pull request
Nov 24, 2026
… until SbPlayer presents Refer to original PR: #13721 After `StartPlayingFrom()` calls `SbPlayerSeek()`, `SbPlayerGetInfo()` may keep returning the pre-seek position until the platform completes the seek asynchronously. `PipelineImpl` only substitutes the seek time until `OnSeekDone`, which is posted right after `StartPlayingFrom()`, and afterwards clamps media time so that it never goes backwards. A stale pre-seek value therefore latches into `PipelineImpl::last_media_time_`, freezing `currentTime` after a backwards seek for the length of the seek. The web app then shows buffering and eventually reloads the player. Cobalt 25's `SbPlayerPipeline::GetMediaTime()` returned the seek time until the SbPlayer reached `kSbPlayerStatePresenting`. This restores that behavior in `StarboardRenderer`: while `buffering_state_` is `BUFFERING_HAVE_NOTHING` (from construction or `Flush()` until the SbPlayer reaches `kSbPlayerStatePresenting`), `GetMediaTime()` reports `seek_time_`. Testing: - Device with an asynchronous SbPlayerSeek() implementation (27.lts build): seeking back 20s while playing froze `currentTime` for ~20s before the change (logs show `SbPlayerGetInfo()` returning 41.39s right after `StartPlayingFrom(21.38s)`), and resumes from the seek target immediately after it. Forward seeks into unbuffered ranges and back-to-back seeks also behave normally. - RDK: not affected before or after, as its `SbPlayerSeek()` records the seek target synchronously. - Added `StarboardRendererTest.GetMediaTimeReportsSeekTimeUntilPresenting` and `StarboardRendererTest.GetMediaTimeReportsSeekTimeAfterBackwardSeek`, which fail without this change (reporting the pre-seek time instead of 20s). `StarboardRendererTest.*` and `SbPlayerBridge*` pass on linux-x64x11 devel. Bug: 575365692 TAG=agy CONV=95eeeebe-e64a-4dba-b215-21568808834d (cherry picked from commit 0fa4078)
cobalt-roller-and-merger Bot
pushed a commit
that referenced
this pull request
Nov 24, 2026
Fixes for rolled commits that build on main but break against staging's newer Chromium base: - third_party/icu/scripts/generate_cobalt_icudata.py (#12800): build the ICU host tools as ICU clients. Since ICU 77, the U_*_IMPLEMENTATION defines move header-only helpers such as icu::toUCharPtr() into icu::internal, so genrb failed to compile with staging's ICU 78: reslist.h:329:48: error: no member named 'toUCharPtr' in namespace 'icu_78' - cobalt/android/cobalt_process_state_summary_jni.cc (#12616): add DEFINE_JNI(CobaltProcessStateSummary). Staging's jni_zero requires it for classes with natives. Without it, Android fails with -Wunused-function on the JNI_ functions, and AOSP fails to link with undefined Muxed_dev_cobalt_coat_CobaltProcessStateSummary_* symbols. - media/starboard/sbplayer_bridge_test.cc (#13807), media/starboard/starboard_renderer_unittest.cc (#13721, #13807) and cobalt/app/app_event_delegate_unittest.cc: pass the lambdas directly to WillOnce()/WillRepeatedly() instead of wrapping them in the deprecated testing::Invoke() (-Werror,-Wdeprecated-declarations). - third_party/blink/renderer/modules/cobalt/h5vcc_system/h_5_vcc_system.cc (#13593): use BindOnce instead of WTF::BindOnce, since staging's Blink no longer has the WTF namespace. - cobalt/browser/h5vcc_system/h5vcc_system_impl_android.cc and cobalt/browser/h5vcc_system_browsertest.cc (#13593): use base::android::android_info::sdk_int()/SDK_VERSION_R. Staging's base no longer has base/android/build_info.h. Bug: 574599290 TAG=agy CONV=2c5cf2b4-5ccb-4755-8885-0e4970a60804
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.
After
StartPlayingFrom()callsSbPlayerSeek(),SbPlayerGetInfo()may keep returning the pre-seek position until the platform completes the seek asynchronously.PipelineImplonly substitutes the seek time untilOnSeekDone, which is posted right afterStartPlayingFrom(), and afterwards clamps media time so that it never goes backwards. A stale pre-seek value therefore latches intoPipelineImpl::last_media_time_, freezingcurrentTimeafter a backwards seek for the length of the seek. The web app then shows buffering and eventually reloads the player.Cobalt 25's
SbPlayerPipeline::GetMediaTime()returned the seek time until the SbPlayer reachedkSbPlayerStatePresenting. This restores that behavior inStarboardRenderer: whilebuffering_state_isBUFFERING_HAVE_NOTHING(from construction orFlush()until the SbPlayer reacheskSbPlayerStatePresenting),GetMediaTime()reportsseek_time_.Testing:
currentTimefor ~20s before the change (logs showSbPlayerGetInfo()returning 41.39s right afterStartPlayingFrom(21.38s)), and resumes from the seek target immediately after it. Forward seeks into unbuffered ranges and back-to-back seeks also behave normally.SbPlayerSeek()records the seek target synchronously.StarboardRendererTest.GetMediaTimeReportsSeekTimeUntilPresentingandStarboardRendererTest.GetMediaTimeReportsSeekTimeAfterBackwardSeek, which fail without this change (reporting the pre-seek time instead of 20s).StarboardRendererTest.*andSbPlayerBridge*pass on linux-x64x11 devel.Bug: 575365692
TAG=agy
CONV=95eeeebe-e64a-4dba-b215-21568808834d