Bug 1135170 - Pin MediaResource in OggReader::GetSeekRanges. r=mattwoodrow

All consumers of MediaCacheStream::GetCachedRanges do this except this one.
This commit is contained in:
Bobby Holley 2015-03-02 09:47:04 -08:00
parent 8e66b38e57
commit edce4188ef

View File

@ -1182,8 +1182,9 @@ int64_t OggReader::RangeEndTime(int64_t aStartOffset,
nsresult OggReader::GetSeekRanges(nsTArray<SeekRange>& aRanges)
{
NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
AutoPinned<MediaResource> resource(mDecoder->GetResource());
nsTArray<MediaByteRange> cached;
nsresult res = mDecoder->GetResource()->GetCachedRanges(cached);
nsresult res = resource->GetCachedRanges(cached);
NS_ENSURE_SUCCESS(res, res);
for (uint32_t index = 0; index < cached.Length(); index++) {