Summary: | [MSE] SourceBuffer::provideMediaData() may remove sample from decode queue unexpectedly | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Daniel Zhang <zhangququ> | ||||||
Component: | Media | Assignee: | Alicia Boya García <aboya> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | aboya, commit-queue, jer.noble, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Daniel Zhang
2017-12-11 04:53:07 PST
I think you are right. The sample should only be removed from the decodeQueue after it's certain that it will be enqueued to the decoders. (Or if a the entire decodeQueue has to be flushed because of a seek). Created attachment 350964 [details]
Patch
Better late than never, here is a patch including a test case. Comment on attachment 350964 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=350964&action=review > LayoutTests/media/media-source/media-source-append-acb-no-frame-lost.html:42 > + let updateEnd = waitFor(sourceBuffer, 'updateend'); > + run('sourceBuffer.appendBuffer(initSegment)'); > + await updateEnd; Just a little nit: because events will never be fired before the current run-loop yields, it's safe to restructure this to: run('sourceBuffer.appendBuffer(initSegment)'); await waitFor(sourceBuffer, 'updateend'); (I wish we could go back in time and change appendBuffer(...) to return a Promise<void>.) Created attachment 350986 [details]
Patch
Comment on attachment 350986 [details] Patch Clearing flags on attachment: 350986 Committed r236566: <https://trac.webkit.org/changeset/236566> All reviewed patches have been landed. Closing bug. |