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

Unified Diff: webkit/media/webmediaplayer_impl.cc

Issue 10680004: HACK on m21 branch 1180 to avoid flickering of buffered bar by lying. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/webmediaplayer_impl.cc
===================================================================
--- webkit/media/webmediaplayer_impl.cc (revision 144240)
+++ webkit/media/webmediaplayer_impl.cc (working copy)
@@ -473,11 +473,18 @@
DCHECK_EQ(main_loop_, MessageLoop::current());
media::Ranges<base::TimeDelta> buffered_time_ranges =
pipeline_->GetBufferedTimeRanges();
- WebKit::WebTimeRanges web_ranges(buffered_time_ranges.size());
- for (size_t i = 0; i < buffered_time_ranges.size(); ++i) {
- web_ranges[i].start = buffered_time_ranges.start(i).InSecondsF();
- web_ranges[i].end = buffered_time_ranges.end(i).InSecondsF();
- }
+
+ // HACK http://crrev.com/143765 was deemed to large to merge to m21, so *only
+ // on the 1180 branch* we fake out buffered() to return
+ // [0,min(duration, max(currentTime+0.5, buffered.end(lastRange)))).
+ if (buffered_time_ranges.size() == 0)
+ return buffered_;
+ float fake_end = std::min(duration(), std::max(
+ currentTime() + 0.5f, static_cast<float>(buffered_time_ranges.end(
+ buffered_time_ranges.size() - 1).InSecondsF())));
+ WebKit::WebTimeRanges web_ranges(static_cast<size_t>(1));
scherkus (not reviewing) 2012/06/27 17:52:18 1u doesn't work!? :~(
Ami GONE FROM CHROMIUM 2012/06/27 18:15:19 Nope. The template foo in WebVector tries to trea
+ web_ranges[0].start = 0;
+ web_ranges[0].end = fake_end;
buffered_.swap(web_ranges);
return buffered_;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698