Bug 1413858 - Resume() needs to reset mPendingSeekOffset before calling Seek().
MozReview-Commit-ID: GbZ3SvSTMvR
--- a/dom/media/ChannelMediaResource.cpp
+++ b/dom/media/ChannelMediaResource.cpp
@@ -739,19 +739,20 @@ ChannelMediaResource::Resume()
// If mOffset is at the end of the stream, then we shouldn't try to
// seek to it. The seek will fail and be wasted anyway. We can leave
// the channel dead; if the media cache wants to read some other data
// in the future, it will call CacheClientSeek itself which will reopen the
// channel.
if (totalLength < 0 || GetOffset() < totalLength) {
// There is (or may be) data to read, so start reading it.
// Need to recreate the channel.
- Seek(mPendingSeekOffset != -1 ? mPendingSeekOffset : GetOffset(),
- false);
+ int64_t offset =
+ mPendingSeekOffset != -1 ? mPendingSeekOffset : GetOffset();
mPendingSeekOffset = -1;
+ Seek(offset, false);
element->DownloadResumed();
} else {
// The channel remains dead. Do not notify DownloadResumed() which
// will leave the media element in NETWORK_LOADING state.
}
}
}
}