Bug 245739

Summary: [GStreamer] Fix player stucking in buffering (paused) state for progressive streaming
Product: WebKit Reporter: Enrique Ocaña <eocanha>
Component: MediaAssignee: Enrique Ocaña <eocanha>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Enrique Ocaña 2022-09-27 09:18:20 PDT
When play state is changed from PAUSED to PLAYING and buffering is detected in the same updateStates() run, the pipeline state is changed back to PAUSED just before triggering playbackStateChanged() notification. As a result, at the time of running playbackStateChanged() player is already marked as paused, triggering pauseInternal() from HTMLMediaElement.

Once the buffering is completed and the player tries to change pipeline state from PAUSED back to PLAYING (setting ReadyState and NetworkState accordingly), it is instantly blocked by HTMLMediaElement (from setReadyState()->updatePlayState()) as according to the HTMLMediaPlayer object the player should be paused (shouldBePlaying evaluates to false). In that case, m_player->pause() is called, bringing player back to PAUSED state. As a result, the player can't really exit buffering state by its own and requires external input (like HTMLMediaElement::play()).

See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/945
Comment 1 Enrique Ocaña 2022-09-27 09:32:26 PDT
Pull request: https://github.com/WebKit/WebKit/pull/4757
Comment 2 EWS 2022-10-04 01:26:35 PDT
Committed 255113@main (b72b805d48b6): <https://commits.webkit.org/255113@main>

Reviewed commits have been landed. Closing PR #4757 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2022-10-04 01:27:21 PDT
<rdar://problem/100752694>