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

Unified Diff: media/audio/mac/audio_output_mac.h

Issue 10560038: Change the way we are stopping audio stream on Mac once again. (Closed) Base URL: http://src.chromium.org/svn/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 side-by-side diff with in-line comments
Download patch
Index: media/audio/mac/audio_output_mac.h
===================================================================
--- media/audio/mac/audio_output_mac.h (revision 142757)
+++ media/audio/mac/audio_output_mac.h (working copy)
@@ -51,6 +51,11 @@
// Check and move channels if surround sound layout needs adjusted.
bool CheckForAdjustedLayout(Channels input_channel, Channels output_channel);
+ // Callback we are installing to find out when the stream is stopped.
+ static void IsRunningCallback(void* p_this,
+ AudioQueueRef queue,
+ AudioQueuePropertyID inID);
+
// The OS calls back here when an audio buffer has been processed.
static void RenderCallback(void* p_this, AudioQueueRef queue,
AudioQueueBufferRef buffer);
@@ -98,11 +103,13 @@
bool should_down_mix_;
// Event used for synchronization when stopping the stream.
- // Callback sets it after stream is stopped.
+ // Callback sets it after stream is fully stopped.
base::WaitableEvent stopped_event_;
- // When stopping we keep track of number of buffers in flight and
- // signal "stop completed" from the last buffer's callback.
- int num_buffers_left_;
+ // Flag set by rendering callback when it asks OS to stop the stream.
+ // All subsequent renderer callbacks calls just exit immediately, they
+ // are called to release the buffer (and we do it when closing the stream,
+ // not in the callback).
+ bool stop_requested_;
DISALLOW_COPY_AND_ASSIGN(PCMQueueOutAudioOutputStream);
};

Powered by Google App Engine
This is Rietveld 408576698