-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not add failed push operations in the BufferedHistory
This commit fixes a kind of rare issue that is tricky to reproduce that may happen after a `QuotaExceededError` is encountered when pushing a chunk to the audio and video `SourceBuffer` due to memory limitations. In that situation, we could be left in the following scenario: 1. We're loading a chunk and pushing it to the `SourceBuffer` 2. The `SourceBuffer` throws a `QuotaExceededError`, generally this means that the device needs more memory to add that chunk 3. The SegmentBuffer code still adds the chunk to its `SegmentInventory` (as it may still have been partially pushed to the SourceBuffer, we're not 100% sure of what happened on the lower-level code) and to that `SegmentInventory`'s `BufferedHistory`. 4. The stream code catches the error, try to remove some buffered data and retry to push the same chunk. 5. Same QuotaExceededError 6. The SegmentBuffer code agains, re do the whole `SegmentInventory` + `BufferedHistory` insertion thing for the same reasons 7. The stream code re-catches the issue, here it takes more drastic measures, mainly reducing the amount of buffer that is built in advance. 8. The stream code then check if it re-needs the chunk. However, it sees through the `BufferedHistory` that it already tried to load it two times, and that in those two times, the browser did not buffer it (there ignoring that there was a `QuotaExceededError` involved). 9. The stream code thus assumes a browser/device issue with that segment, and loads the next one instead. 10. When it's time to decode the skipped chunk, the RxPlayer automatically seek over it, which is good, but we would have prefered to actually log it. This commit fixes the issue by clearly identifying in the `SegmentInventory` chunks whose push operation had an issue. Those are: 1. never added to the `BufferedHistory` 2. always re-loaded if they become needed again We could also have not added them to the `SegmentInventory` altogether but I still think it's better to do it, as in the very rare chance that chunk still had been at least partially pushed, our logic would be more accurate.
- Loading branch information
1 parent
ff213e1
commit 79ebbfc
Showing
8 changed files
with
68 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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