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

Unified Diff: media/base/pipeline.cc

Issue 10698134: Merge 143765 - Ensure media's buffered ranges always have a range that includes currentTime. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « media/base/pipeline.h ('k') | media/base/pipeline_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline.cc
===================================================================
--- media/base/pipeline.cc (revision 145933)
+++ media/base/pipeline.cc (working copy)
@@ -204,6 +204,10 @@
Ranges<TimeDelta> time_ranges;
if (clock_->Duration() == TimeDelta() || total_bytes_ == 0)
return time_ranges;
+ for (size_t i = 0; i < buffered_time_ranges_.size(); ++i) {
+ time_ranges.Add(buffered_time_ranges_.start(i),
+ buffered_time_ranges_.end(i));
+ }
for (size_t i = 0; i < buffered_byte_ranges_.size(); ++i) {
TimeDelta start = TimeForByteOffset_Locked(buffered_byte_ranges_.start(i));
TimeDelta end = TimeForByteOffset_Locked(buffered_byte_ranges_.end(i));
@@ -457,6 +461,14 @@
did_loading_progress_ = true;
}
+void Pipeline::AddBufferedTimeRange(base::TimeDelta start,
+ base::TimeDelta end) {
+ DCHECK(IsRunning());
+ base::AutoLock auto_lock(lock_);
+ buffered_time_ranges_.Add(start, end);
+ did_loading_progress_ = true;
+}
+
void Pipeline::SetNaturalVideoSize(const gfx::Size& size) {
DCHECK(IsRunning());
media_log_->AddEvent(media_log_->CreateVideoSizeSetEvent(
« no previous file with comments | « media/base/pipeline.h ('k') | media/base/pipeline_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698