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

Unified Diff: media/base/clock.cc

Issue 10800041: Update media duration if data is appended after the previous duration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase ToT 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 | « no previous file | media/filters/chunk_demuxer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/clock.cc
diff --git a/media/base/clock.cc b/media/base/clock.cc
index 06f1b5686ccea50fb2de7e1b98849d636b520ba8..2432f91e47bf75418de23a12faffde85ccf38215 100644
--- a/media/base/clock.cc
+++ b/media/base/clock.cc
@@ -80,9 +80,12 @@ void Clock::SetMaxTime(base::TimeDelta max_time) {
}
void Clock::SetDuration(base::TimeDelta duration) {
- DCHECK(duration_ == kNoTimestamp() || duration_ == kInfiniteDuration());
DCHECK(duration > base::TimeDelta());
duration_ = duration;
+
+ media_time_ = ClampToValidTimeRange(media_time_);
+ if (max_time_ != kNoTimestamp())
+ max_time_ = ClampToValidTimeRange(max_time_);
}
base::TimeDelta Clock::ElapsedViaProvidedTime(const base::Time& time) const {
« no previous file with comments | « no previous file | media/filters/chunk_demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698