Bug 1426056. P4 - fix a case where we don't reopen the channel.
In MediaCacheStream::NotifyResume(), it will not reopen the channel if
|mChannelOffset==mStreamLength && 0 <= mSeekTarget < mStreamLength| while we should.
MozReview-Commit-ID: 2knkgy6FEVw
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -2309,18 +2309,18 @@ MediaCacheStream::NotifyResume()
"MediaCacheStream::NotifyResume",
[ this, client = RefPtr<ChannelMediaResource>(mClient) ]() {
AutoLock lock(mMediaCache->Monitor());
if (mClosed) {
return;
}
// Don't resume download if we are already at the end of the stream for
// seek will fail and be wasted anyway.
- if (mStreamLength < 0 || mChannelOffset < mStreamLength) {
- int64_t offset = mSeekTarget != -1 ? mSeekTarget : mChannelOffset;
+ int64_t offset = mSeekTarget != -1 ? mSeekTarget : mChannelOffset;
+ if (mStreamLength < 0 || offset < mStreamLength) {
mClient->CacheClientSeek(offset, false);
// DownloadResumed() will be notified when a new channel is opened.
}
// The channel remains dead. If we want to read some other data in the
// future, CacheClientSeek() will be called to reopen the channel.
});
OwnerThread()->Dispatch(r.forget());
}