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

Side by Side Diff: media/mojo/services/mojo_renderer_service.cc

Issue 2276663003: Fix DCHECK in MojoRendererService::SetPlaybackRate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « media/mojo/clients/mojo_renderer_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/mojo/services/mojo_renderer_service.h" 5 #include "media/mojo/services/mojo_renderer_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "media/base/media_keys.h" 10 #include "media/base/media_keys.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 74
75 void MojoRendererService::StartPlayingFrom(base::TimeDelta time_delta) { 75 void MojoRendererService::StartPlayingFrom(base::TimeDelta time_delta) {
76 DVLOG(2) << __FUNCTION__ << ": " << time_delta; 76 DVLOG(2) << __FUNCTION__ << ": " << time_delta;
77 renderer_->StartPlayingFrom(time_delta); 77 renderer_->StartPlayingFrom(time_delta);
78 SchedulePeriodicMediaTimeUpdates(); 78 SchedulePeriodicMediaTimeUpdates();
79 } 79 }
80 80
81 void MojoRendererService::SetPlaybackRate(double playback_rate) { 81 void MojoRendererService::SetPlaybackRate(double playback_rate) {
82 DVLOG(2) << __FUNCTION__ << ": " << playback_rate; 82 DVLOG(2) << __FUNCTION__ << ": " << playback_rate;
83 DCHECK_EQ(state_, STATE_PLAYING); 83 DCHECK(state_ == STATE_PLAYING || state_ == STATE_ERROR);
84 renderer_->SetPlaybackRate(playback_rate); 84 renderer_->SetPlaybackRate(playback_rate);
85 } 85 }
86 86
87 void MojoRendererService::SetVolume(float volume) { 87 void MojoRendererService::SetVolume(float volume) {
88 renderer_->SetVolume(volume); 88 renderer_->SetVolume(volume);
89 } 89 }
90 90
91 void MojoRendererService::SetCdm(int32_t cdm_id, 91 void MojoRendererService::SetCdm(int32_t cdm_id,
92 const SetCdmCallback& callback) { 92 const SetCdmCallback& callback) {
93 if (!mojo_cdm_service_context_) { 93 if (!mojo_cdm_service_context_) {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 bool success) { 218 bool success) {
219 DVLOG(1) << __FUNCTION__ << "(" << success << ")"; 219 DVLOG(1) << __FUNCTION__ << "(" << success << ")";
220 220
221 if (success) 221 if (success)
222 cdm_ = cdm; 222 cdm_ = cdm;
223 223
224 callback.Run(success); 224 callback.Run(success);
225 } 225 }
226 226
227 } // namespace media 227 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/clients/mojo_renderer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698