From cdfdcf4aee0791682d738700d5c53d8d299ccff7 Mon Sep 17 00:00:00 2001 From: trav90 Date: Sat, 17 Sep 2016 08:53:58 -0500 Subject: [PATCH] Don't defer reading to a closed stream Other streams in the list bail out of the servicing loop if they're closed, so we can wait indefinitely. --- dom/media/MediaCache.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dom/media/MediaCache.cpp b/dom/media/MediaCache.cpp index cd3b6ce920..065ca568d3 100644 --- a/dom/media/MediaCache.cpp +++ b/dom/media/MediaCache.cpp @@ -1173,8 +1173,10 @@ MediaCache::Update() actions.AppendElement(NONE); MediaCacheStream* stream = mStreams[i]; - if (stream->mClosed) + if (stream->mClosed) { + CACHE_LOG(PR_LOG_DEBUG, ("Stream %p closed", stream)); continue; + } // Figure out where we should be reading from. It's the first // uncached byte after the current mStreamOffset. @@ -1280,7 +1282,7 @@ MediaCache::Update() for (uint32_t j = 0; j < i; ++j) { MediaCacheStream* other = mStreams[j]; if (other->mResourceID == stream->mResourceID && - !other->mClient->IsSuspended() && + !other->mClosed && !other->mClient->IsSuspended() && other->mChannelOffset/BLOCK_SIZE == desiredOffset/BLOCK_SIZE) { // This block is already going to be read by the other stream. // So don't try to read it from this stream as well.