Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(956)

Unified Diff: media/filters/chunk_demuxer.cc

Issue 10581050: Ensure media's buffered ranges always have a range that includes currentTime. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698