mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 08:13:35 +00:00
Bug 1050060 - Fix MP4 range pinning; r=edwin
This commit is contained in:
parent
2c2bccb36d
commit
fa358b339a
@ -758,12 +758,14 @@ void
|
||||
MP4Reader::UpdateIndex()
|
||||
{
|
||||
nsTArray<MediaByteRange> ranges;
|
||||
if (NS_FAILED(mDecoder->GetResource()->GetCachedRanges(ranges))) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsTArray<Interval<Microseconds>> timeRanges;
|
||||
mDemuxer->ConvertByteRangesToTime(ranges, &timeRanges);
|
||||
|
||||
MediaResource* resource = mDecoder->GetResource();
|
||||
resource->Pin();
|
||||
if (NS_SUCCEEDED(resource->GetCachedRanges(ranges))) {
|
||||
mDemuxer->ConvertByteRangesToTime(ranges, &timeRanges);
|
||||
}
|
||||
resource->Unpin();
|
||||
|
||||
MonitorAutoLock mon(mTimeRangesMonitor);
|
||||
mTimeRanges = timeRanges;
|
||||
|
Loading…
Reference in New Issue
Block a user