Index: media/filters/chunk_demuxer.cc |
diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc |
index 8b77834cfdf07baa6b99a96f367ac1be5e973f90..90c64c55b804ce35a7d73f931e690477ff1d15dc 100644 |
--- a/media/filters/chunk_demuxer.cc |
+++ b/media/filters/chunk_demuxer.cc |
@@ -81,13 +81,6 @@ static const SupportedTypeInfo kSupportedTypeInfo[] = { |
#endif |
}; |
- |
-// The fake total size we use for converting times to bytes |
-// for AddBufferedByteRange() calls. |
-// TODO(acolwell): Remove this once Pipeline accepts buffered times |
-// instead of only buffered bytes. |
-enum { kFakeTotalBytes = 1000000 }; |
- |
// Checks to see if the specified |type| and |codecs| list are supported. |
// Returns true if |type| and all codecs listed in |codecs| are supported. |
// |factory_function| contains a function that can build a StreamParser |
@@ -753,15 +746,8 @@ bool ChunkDemuxer::AppendData(const std::string& id, |
} |
} |
- DCHECK(!ranges.size() || duration_ > TimeDelta()); |
- for (size_t i = 0; i < ranges.size(); ++i) { |
- // Notify the host of 'network activity' because we got data. |
- int64 start = |
- kFakeTotalBytes * ranges.start(i).InSecondsF() / duration_.InSecondsF(); |
- int64 end = |
- kFakeTotalBytes * ranges.end(i).InSecondsF() / duration_.InSecondsF(); |
- host_->AddBufferedByteRange(start, end); |
- } |
+ for (size_t i = 0; i < ranges.size(); ++i) |
+ host_->AddBufferedTimeRange(ranges.start(i), ranges.end(i)); |
if (!cb.is_null()) |
cb.Run(PIPELINE_OK); |
@@ -929,8 +915,6 @@ void ChunkDemuxer::OnStreamParserInitDone(bool success, TimeDelta duration) { |
(!source_id_video_.empty() && !video_)) |
return; |
- if (duration_ > TimeDelta() && duration_ != kInfiniteDuration()) |
- host_->SetTotalBytes(kFakeTotalBytes); |
host_->SetDuration(duration_); |
ChangeState_Locked(INITIALIZED); |