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

Side by Side Diff: media/audio/linux/alsa_output.cc

Issue 10533007: Revert 138939 - alsa_output: Drain and pause pcm when stopping. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/audio/linux/alsa_output_unittest.cc » ('j') | 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 // THREAD SAFETY 5 // THREAD SAFETY
6 // 6 //
7 // AlsaPcmOutputStream object is *not* thread-safe and should only be used 7 // AlsaPcmOutputStream object is *not* thread-safe and should only be used
8 // from the audio thread. We DCHECK on this assumption whenever we can. 8 // from the audio thread. We DCHECK on this assumption whenever we can.
9 // 9 //
10 // SEMANTICS OF Close() 10 // SEMANTICS OF Close()
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 WriteTask(); 328 WriteTask();
329 } 329 }
330 } 330 }
331 331
332 void AlsaPcmOutputStream::Stop() { 332 void AlsaPcmOutputStream::Stop() {
333 DCHECK(IsOnAudioThread()); 333 DCHECK(IsOnAudioThread());
334 334
335 // Reset the callback, so that it is not called anymore. 335 // Reset the callback, so that it is not called anymore.
336 set_source_callback(NULL); 336 set_source_callback(NULL);
337 337
338 // Finish playing samples and pause the pcm.
339 wrapper_->PcmDrain(playback_handle_);
340
341 TransitionTo(kIsStopped); 338 TransitionTo(kIsStopped);
342 } 339 }
343 340
344 void AlsaPcmOutputStream::SetVolume(double volume) { 341 void AlsaPcmOutputStream::SetVolume(double volume) {
345 DCHECK(IsOnAudioThread()); 342 DCHECK(IsOnAudioThread());
346 343
347 volume_ = static_cast<float>(volume); 344 volume_ = static_cast<float>(volume);
348 } 345 }
349 346
350 void AlsaPcmOutputStream::GetVolume(double* volume) { 347 void AlsaPcmOutputStream::GetVolume(double* volume) {
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 } 801 }
805 802
806 // Changes the AudioSourceCallback to proxy calls to. Pass in NULL to 803 // Changes the AudioSourceCallback to proxy calls to. Pass in NULL to
807 // release ownership of the currently registered callback. 804 // release ownership of the currently registered callback.
808 void AlsaPcmOutputStream::set_source_callback(AudioSourceCallback* callback) { 805 void AlsaPcmOutputStream::set_source_callback(AudioSourceCallback* callback) {
809 DCHECK(IsOnAudioThread()); 806 DCHECK(IsOnAudioThread());
810 source_callback_ = callback; 807 source_callback_ = callback;
811 } 808 }
812 809
813 } // namespace media 810 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/audio/linux/alsa_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698