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

Unified Diff: webkit/media/webmediaplayer_impl.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 | « media/filters/chunk_demuxer_unittest.cc ('k') | 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
diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc
index b5f65d056bdb0ea80c3722ab69cc44e690c90894..22a1476010dd71671018233f564a36476fd89b24 100644
--- a/webkit/media/webmediaplayer_impl.cc
+++ b/webkit/media/webmediaplayer_impl.cc
@@ -679,7 +679,15 @@ bool WebMediaPlayerImpl::sourceAppend(const WebKit::WebString& id,
const unsigned char* data,
unsigned length) {
DCHECK_EQ(main_loop_, MessageLoop::current());
- return proxy_->DemuxerAppend(id.utf8().data(), data, length);
+
+ float old_duration = duration();
+ if (!proxy_->DemuxerAppend(id.utf8().data(), data, length))
+ return false;
+
+ if (old_duration != duration())
+ GetClient()->durationChanged();
+
+ return true;
}
bool WebMediaPlayerImpl::sourceAbort(const WebKit::WebString& id) {
@@ -705,7 +713,11 @@ void WebMediaPlayerImpl::sourceEndOfStream(
NOTIMPLEMENTED();
}
+ float old_duration = duration();
proxy_->DemuxerEndOfStream(pipeline_status);
+
+ if (old_duration != duration())
+ GetClient()->durationChanged();
}
WebKit::WebMediaPlayer::MediaKeyException
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698