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

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

Issue 443393002: Stop using WebMediaPlayerClient::preload() and volume() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « content/renderer/media/webmediaplayer_ms.h ('k') | no next file » | 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 b466d3168aab617b38a6ea1dde0b46a2e174ceeb..45bcc7b377dea25934d42301feb0909132147842 100644
--- a/content/renderer/media/webmediaplayer_ms.cc
+++ b/content/renderer/media/webmediaplayer_ms.cc
@@ -87,6 +87,7 @@ WebMediaPlayerMS::WebMediaPlayerMS(
network_state_(WebMediaPlayer::NetworkStateEmpty),
ready_state_(WebMediaPlayer::ReadyStateHaveNothing),
buffered_(static_cast<size_t>(1)),
+ volume_(1.0f),
client_(client),
delegate_(delegate),
paused_(true),
@@ -135,7 +136,6 @@ void WebMediaPlayerMS::load(LoadType load_type,
GURL gurl(url);
- setVolume(GetClient()->volume());
SetNetworkState(WebMediaPlayer::NetworkStateLoading);
SetReadyState(WebMediaPlayer::ReadyStateHaveNothing);
media_log_->AddEvent(media_log_->CreateLoadEvent(url.spec()));
@@ -152,8 +152,10 @@ void WebMediaPlayerMS::load(LoadType load_type,
frame->GetRoutingID());
if (video_frame_provider_.get() || audio_renderer_.get()) {
- if (audio_renderer_.get())
+ if (audio_renderer_.get()) {
+ audio_renderer_->SetVolume(volume_);
audio_renderer_->Start();
+ }
if (video_frame_provider_.get()) {
video_frame_provider_->Start();
@@ -234,10 +236,10 @@ void WebMediaPlayerMS::setRate(double rate) {
void WebMediaPlayerMS::setVolume(double volume) {
DCHECK(thread_checker_.CalledOnValidThread());
- if (!audio_renderer_.get())
- return;
DVLOG(1) << "WebMediaPlayerMS::setVolume(volume=" << volume << ")";
- audio_renderer_->SetVolume(volume);
+ volume_ = volume;
+ if (audio_renderer_.get())
+ audio_renderer_->SetVolume(volume_);
}
void WebMediaPlayerMS::setPreload(WebMediaPlayer::Preload preload) {
« no previous file with comments | « content/renderer/media/webmediaplayer_ms.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698