Bug 1136984 - Use correct units for comparing timestamps in TrackBuffer::RangeRemoval. r=jya

This commit is contained in:
Matt Woodrow 2015-02-27 11:47:46 +13:00
parent 1d18ab6706
commit a440a4ab84

View File

@ -1008,7 +1008,7 @@ TrackBuffer::RangeRemoval(int64_t aStart, int64_t aEnd)
for (size_t i = 0; i < decoders.Length(); ++i) {
nsRefPtr<dom::TimeRanges> buffered = new dom::TimeRanges();
decoders[i]->GetBuffered(buffered);
if (buffered->GetEndTime() < aEnd) {
if (int64_t(buffered->GetEndTime() * USECS_PER_S) < aEnd) {
// Can be fully removed.
MSE_DEBUG("remove all bufferedEnd=%f time=%f, size=%lld",
buffered->GetEndTime(), time,
@ -1027,7 +1027,7 @@ TrackBuffer::RangeRemoval(int64_t aStart, int64_t aEnd)
} else {
// Only trimming existing buffers.
for (size_t i = 0; i < decoders.Length(); ++i) {
if (aStart <= buffered->GetStartTime()) {
if (aStart <= int64_t(buffered->GetStartTime() * USECS_PER_SEC)) {
// It will be entirely emptied, can clear all data.
decoders[i]->GetResource()->EvictAll();
} else {