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

Unified Diff: content/renderer/media/webmediaplayer_ms.cc

Issue 2108153002: Do not wait for first video frame to start playing audio in a MediaStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 4 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 | content/test/data/media/getusermedia.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webmediaplayer_ms.cc
diff --git a/content/renderer/media/webmediaplayer_ms.cc b/content/renderer/media/webmediaplayer_ms.cc
index d437247d18053d97a778c326d8bc707e6b520d81..b03fedd8d5365e00e9c19a7bc58af7418c6bf407 100644
--- a/content/renderer/media/webmediaplayer_ms.cc
+++ b/content/renderer/media/webmediaplayer_ms.cc
@@ -152,8 +152,8 @@ void WebMediaPlayerMS::load(LoadType load_type,
}
if (video_frame_provider_)
video_frame_provider_->Start();
- if (audio_renderer_ && !video_frame_provider_) {
- // This is audio-only mode.
+ if (audio_renderer_) {
+ // Do not wait for first video frame to start playing
SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata);
SetReadyState(WebMediaPlayer::ReadyStateHaveEnoughData);
}
@@ -488,8 +488,10 @@ void WebMediaPlayerMS::OnFrameAvailable(
if (!received_first_frame_) {
received_first_frame_ = true;
- SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata);
- SetReadyState(WebMediaPlayer::ReadyStateHaveEnoughData);
+ if (getReadyState() < WebMediaPlayer::ReadyStateHaveEnoughData) {
+ SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata);
+ SetReadyState(WebMediaPlayer::ReadyStateHaveEnoughData);
+ }
if (video_frame_provider_.get()) {
video_weblayer_.reset(new cc_blink::WebLayerImpl(
« no previous file with comments | « no previous file | content/test/data/media/getusermedia.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698