New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MSE] Skip initial buffering rate computation #10793
Conversation
EWS run on previous version of this PR (hash 2026e03) |
The patch as it is is causing 3 regressions in glib platforms:
I'm going to have a quick look into them before considering merging the patch. |
Seems to break tests on mac ports too. |
EWS run on current version of this PR (hash b16b73b) |
The problem seemed to be that just one call to |
@jernoble, if you confirm that you don't see anything wrong about calling |
@jernoble, in case there's no complain from your side in some days, I'll merge this PR next week. |
https://bugs.webkit.org/show_bug.cgi?id=253074 Reviewed by Jer Noble. m_timeOfBufferingMonitor is initialized in SourceBuffer at creation time. If the first call to monitorBufferingRate() takes too much to happen for whatever reason (eg: because the webpage takes too much to perform the first append), the computed interval is already going to be too big and generate an artificially low m_averageBufferRate. To mitigate this, I've added code to initialize m_timeOfBufferingMonitor to zero, detect that special value in monitorBufferingRate() and skip the first time that the rate computation is done (just assigning the "now" time to m_timeOfBufferingMonitor, so when the next update is done, the interval is most realistic). However, since monitorBufferingRate() calls are only done from canPlayThroughRange() and that call might happen only once in some layout tests and production scenarios, m_averageBufferRate might not reach accurate values on time and make the test fail. To mitigate that, I've also added extra calls every time a buffer is appended and every time the append completes. See: WebPlatformForEmbedded/WPEWebKit#928 (comment) * Source/WebCore/Modules/mediasource/SourceBuffer.cpp: Initialize m_timeOfBufferingMonitor to zero, meaning "never updated before". (WebCore::SourceBuffer::appendBuffer): Update monitorBufferingRate. (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): UpdateMonitorBufferingRate. (WebCore::SourceBuffer::monitorBufferingRate): Skip first m_averageBufferRate update. Canonical link: https://commits.webkit.org/261328@main
b16b73b
to
1581c8a
Compare
Committed 261328@main (1581c8a): https://commits.webkit.org/261328@main Reviewed commits have been landed. Closing PR #10793 and removing active labels. |
1581c8a
b16b73b