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

Unified Diff: media/audio/mac/audio_auhal_mac.cc

Issue 1973503003: (Relanding) Restores larger output buffer size when output stream requiring smaller size is closed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added comment Created 4 years, 7 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
« no previous file with comments | « media/audio/mac/audio_auhal_mac.h ('k') | media/audio/mac/audio_manager_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_auhal_mac.cc
diff --git a/media/audio/mac/audio_auhal_mac.cc b/media/audio/mac/audio_auhal_mac.cc
index d71673fd12ae517dd61f0fdedabda64d2e7e4077..42cd16d88a6df4ab30b226655ba3b2ea008ef58c 100644
--- a/media/audio/mac/audio_auhal_mac.cc
+++ b/media/audio/mac/audio_auhal_mac.cc
@@ -123,8 +123,10 @@ void AUHALStream::Close() {
DVLOG(1) << "Close";
CloseAudioUnit();
// Inform the audio manager that we have been closed. This will cause our
- // destruction.
- manager_->ReleaseOutputStream(this);
+ // destruction. Also include the device ID as a signal to the audio manager
+ // that it should try to increase the native I/O buffer size after the stream
+ // has been closed.
+ manager_->ReleaseOutputStreamUsingRealDevice(this, device_);
}
void AUHALStream::Start(AudioSourceCallback* callback) {
@@ -175,6 +177,7 @@ void AUHALStream::Stop() {
if (stopped_)
return;
DVLOG(1) << "Stop";
+ DVLOG(2) << "number_of_frames: " << number_of_frames_;
OSStatus result = AudioOutputUnitStop(audio_unit_);
OSSTATUS_DLOG_IF(ERROR, result != noErr, result)
<< "AudioOutputUnitStop() failed.";
@@ -218,8 +221,7 @@ OSStatus AUHALStream::Render(
// changes reflected in UMA stats.
number_of_frames_requested_ = number_of_frames;
DVLOG(1) << "Audio frame size changed from " << number_of_frames_
- << " to " << number_of_frames
- << "; adding FIFO to compensate.";
+ << " to " << number_of_frames << " adding FIFO to compensate.";
audio_fifo_.reset(new AudioPullFifo(
output_channels_,
number_of_frames_,
« no previous file with comments | « media/audio/mac/audio_auhal_mac.h ('k') | media/audio/mac/audio_manager_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698