mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #22433 - ferjm:player.eos.size, r=ceyusa
Improve implementation of media resource fetch algorithm
I have been observing inconsistent behaviors with my local tests depending of the media asset being played. I figured that we had these issues:
- We were setting the player EOS as soon as we got the first [process_response_eof](1046ae58a1/components/script/dom/htmlmediaelement.rs (L1596)
). This is fine only if there is a single request. But that's not the case for multiple range requests or for seeks. Setting the player EOS makes the player appsrc reject any new buffers, and that breaks playback. Figuring out when is the right time to set the player EOS won't be a straight forward task, so my suggested fix for now is to simply not set it for now. It is a cleanup step that it would be nice to have but it is not mandatory.
- We were setting the input size more than once for multiple range requests and with the incorrect value. The fix uses the `content-length` or the `content-range` headers for single and range requests respectively.
- We were moving to the HaveEnoughData state if a fetch request succeded but no data was fetched from the network.
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22433)
<!-- Reviewable:end -->
This commit is contained in:
commit
eab848df3e
5 changed files with 39 additions and 32 deletions
|
@ -1,4 +0,0 @@
|
|||
[load-events-networkState.html]
|
||||
[NETWORK_NO_SOURCE]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[resource-selection-invoke-insert-into-iframe.html]
|
||||
[NOT invoking resource selection by inserting into other document with src set]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[resource-selection-invoke-pause-networkState.html]
|
||||
[NOT invoking resource selection with pause() when networkState is not NETWORK_EMPTY]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[resource-selection-invoke-remove-from-document-networkState.html]
|
||||
[NOT invoking resource selection with implicit pause() when networkState is not NETWORK_EMPTY]
|
||||
expected: FAIL
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue