Bug 1515068 - Allow UpdateSrcStreamTime while paused. r=jya

This can legitimately happen while paused since the watchmanager calling this
is dispatching the calls. As such they're out of sync with the paused state,
and we need to allow updating the time while paused.

FireTimeUpdate does ignore the call if the time hasn't actually been updated,
so the only impact from this is that we could do a lot of unnecessary
dispatching while paused without noticing.

Differential Revision: https://phabricator.services.mozilla.com/D15731
This commit is contained in:
Andreas Pehrson
2019-01-09 17:15:18 +00:00
parent df5d195332
commit 2145f114db

View File

@@ -4627,9 +4627,12 @@ void HTMLMediaElement::UpdateSrcMediaStreamPlaying(uint32_t aFlags) {
void HTMLMediaElement::UpdateSrcStreamTime() {
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(mSrcStreamPausedGraphTime == GRAPH_TIME_MAX);
MOZ_ASSERT(!mPaused);
MOZ_ASSERT(!mSrcStreamPlaybackEnded);
if (mSrcStreamPlaybackEnded) {
// We do a separate FireTimeUpdate() when this is set.
return;
}
FireTimeUpdate(true);
}