mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1205825 - part 2 - call Get*CachedData*Internal variants from MediaCacheStream::GetCachedRanges; r=roc
Each of GetNextCachedData and GetCachedDataEndInternal grab the monitor on entrance, but GetCachedRanges has already grabbed the monitor for us. We can call the *Internal variants instead, which assert that the monitor is held.
This commit is contained in:
parent
ee09350fca
commit
63df15ccef
@ -2461,13 +2461,13 @@ nsresult MediaCacheStream::GetCachedRanges(nsTArray<MediaByteRange>& aRanges)
|
||||
// shrink while we're trying to loop over them.
|
||||
NS_ASSERTION(mPinCount > 0, "Must be pinned");
|
||||
|
||||
int64_t startOffset = GetNextCachedData(0);
|
||||
int64_t startOffset = GetNextCachedDataInternal(0);
|
||||
while (startOffset >= 0) {
|
||||
int64_t endOffset = GetCachedDataEnd(startOffset);
|
||||
int64_t endOffset = GetCachedDataEndInternal(startOffset);
|
||||
NS_ASSERTION(startOffset < endOffset, "Buffered range must end after its start");
|
||||
// Bytes [startOffset..endOffset] are cached.
|
||||
aRanges.AppendElement(MediaByteRange(startOffset, endOffset));
|
||||
startOffset = GetNextCachedData(endOffset);
|
||||
startOffset = GetNextCachedDataInternal(endOffset);
|
||||
NS_ASSERTION(startOffset == -1 || startOffset > endOffset,
|
||||
"Must have advanced to start of next range, or hit end of stream");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user