Bug 1136576: Properly align source buffer starts with current decoder. r=cajbir

This commit is contained in:
Jean-Yves Avenard 2015-02-25 20:55:14 +11:00
parent ca5abc580a
commit b76671320c

View File

@ -427,9 +427,15 @@ TrackBuffer::EvictData(double aPlaybackTime,
bool evicted = toEvict < (totalSize - aThreshold);
if (evicted) {
nsRefPtr<dom::TimeRanges> ranges = new dom::TimeRanges();
mCurrentDecoder->GetBuffered(ranges);
*aBufferStartTime = std::max(0.0, ranges->GetStartTime());
if (playingDecoder) {
nsRefPtr<dom::TimeRanges> ranges = new dom::TimeRanges();
playingDecoder->GetBuffered(ranges);
*aBufferStartTime = std::max(0.0, ranges->GetStartTime());
} else {
// We do not currently have data to play yet.
// Avoid evicting anymore data to minimize rebuffering time.
*aBufferStartTime = 0.0;
}
}
return evicted;