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

Side by Side Diff: media/audio/mac/audio_unified_mac.cc

Issue 10963062: AudioHardwareUnifiedStream::Stop() must not clear |source_| before calling AudioDeviceStop(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/audio/mac/audio_unified_mac.h" 5 #include "media/audio/mac/audio_unified_mac.h"
6 6
7 #include <CoreServices/CoreServices.h> 7 #include <CoreServices/CoreServices.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 OSSTATUS_DCHECK(result == noErr, result); 271 OSSTATUS_DCHECK(result == noErr, result);
272 272
273 if (result == noErr) 273 if (result == noErr)
274 is_playing_ = true; 274 is_playing_ = true;
275 } 275 }
276 276
277 void AudioHardwareUnifiedStream::Stop() { 277 void AudioHardwareUnifiedStream::Stop() {
278 if (!is_playing_) 278 if (!is_playing_)
279 return; 279 return;
280 280
281 source_ = NULL;
282
283 if (device_ != kAudioObjectUnknown) { 281 if (device_ != kAudioObjectUnknown) {
284 OSStatus result = AudioDeviceStop(device_, io_proc_id_); 282 OSStatus result = AudioDeviceStop(device_, io_proc_id_);
285 OSSTATUS_DCHECK(result == noErr, result); 283 OSSTATUS_DCHECK(result == noErr, result);
286 } 284 }
287 285
288 is_playing_ = false; 286 is_playing_ = false;
287 source_ = NULL;
289 } 288 }
290 289
291 void AudioHardwareUnifiedStream::SetVolume(double volume) { 290 void AudioHardwareUnifiedStream::SetVolume(double volume) {
292 volume_ = static_cast<float>(volume); 291 volume_ = static_cast<float>(volume);
293 // TODO(crogers): set volume property 292 // TODO(crogers): set volume property
294 } 293 }
295 294
296 void AudioHardwareUnifiedStream::GetVolume(double* volume) { 295 void AudioHardwareUnifiedStream::GetVolume(double* volume) {
297 *volume = volume_; 296 *volume = volume_;
298 } 297 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 return audio_output->Render( 389 return audio_output->Render(
391 device, 390 device,
392 now, 391 now,
393 input_data, 392 input_data,
394 input_time, 393 input_time,
395 output_data, 394 output_data,
396 output_time); 395 output_time);
397 } 396 }
398 397
399 } // namespace media 398 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698