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

Side by Side Diff: media/audio/win/waveout_output_win.cc

Issue 13692002: Update calls to scoped_array<T>::reset(NULL) to use the no-arg version. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Prepare for landing! Created 7 years, 8 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/win/waveout_output_win.h" 5 #include "media/audio/win/waveout_output_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <mmsystem.h> 8 #include <mmsystem.h>
9 #pragma comment(lib, "winmm.lib") 9 #pragma comment(lib, "winmm.lib")
10 10
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // this does but we can guess that causes the OS to keep a reference to 161 // this does but we can guess that causes the OS to keep a reference to
162 // the memory pages so the driver can use them without worries. 162 // the memory pages so the driver can use them without worries.
163 ::waveOutPrepareHeader(waveout_, buffer, sizeof(WAVEHDR)); 163 ::waveOutPrepareHeader(waveout_, buffer, sizeof(WAVEHDR));
164 } 164 }
165 } 165 }
166 166
167 void PCMWaveOutAudioOutputStream::FreeBuffers() { 167 void PCMWaveOutAudioOutputStream::FreeBuffers() {
168 for (int ix = 0; ix != num_buffers_; ++ix) { 168 for (int ix = 0; ix != num_buffers_; ++ix) {
169 ::waveOutUnprepareHeader(waveout_, GetBuffer(ix), sizeof(WAVEHDR)); 169 ::waveOutUnprepareHeader(waveout_, GetBuffer(ix), sizeof(WAVEHDR));
170 } 170 }
171 buffers_.reset(NULL); 171 buffers_.reset();
172 } 172 }
173 173
174 // Initially we ask the source to fill up all audio buffers. If we don't do 174 // Initially we ask the source to fill up all audio buffers. If we don't do
175 // this then we would always get the driver callback when it is about to run 175 // this then we would always get the driver callback when it is about to run
176 // samples and that would leave too little time to react. 176 // samples and that would leave too little time to react.
177 void PCMWaveOutAudioOutputStream::Start(AudioSourceCallback* callback) { 177 void PCMWaveOutAudioOutputStream::Start(AudioSourceCallback* callback) {
178 if (state_ != PCMA_READY) 178 if (state_ != PCMA_READY)
179 return; 179 return;
180 callback_ = callback; 180 callback_ = callback;
181 181
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 buffer, 416 buffer,
417 sizeof(WAVEHDR)); 417 sizeof(WAVEHDR));
418 if (result != MMSYSERR_NOERROR) 418 if (result != MMSYSERR_NOERROR)
419 stream->HandleError(result); 419 stream->HandleError(result);
420 stream->pending_bytes_ += buffer->dwBufferLength; 420 stream->pending_bytes_ += buffer->dwBufferLength;
421 } 421 }
422 } 422 }
423 } 423 }
424 424
425 } // namespace media 425 } // 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