Chromium Code Reviews| 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..174eb4518f0ceff5199f2475e53d300c93096875 100644 |
| --- a/media/audio/mac/audio_auhal_mac.cc |
| +++ b/media/audio/mac/audio_auhal_mac.cc |
| @@ -122,6 +122,11 @@ void AUHALStream::Close() { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| DVLOG(1) << "Close"; |
| CloseAudioUnit(); |
| + // Notify the audio manager about an upcoming call to ReleaseOutputStream() |
| + // and also provide the device ID of the utilized audio device. This is a |
| + // trick to ensure that the audio manager only tries to increase the native |
| + // I/O buffer size for real audio streams and not for e.g. fake streams. |
| + manager_->PrepareForAttemptToIncreaseIOBufferSize(device_); |
|
o1ka
2016/05/12 11:30:17
Ah ok, I see what you mean. Could we simplify it a
o1ka
2016/05/12 12:04:15
(Actually, it should be named differently, because
henrika (OOO until Aug 14)
2016/05/12 13:02:08
Well, that does not seem that strict but OK I can
henrika (OOO until Aug 14)
2016/05/12 13:02:08
Good idea. Done.
|
| // Inform the audio manager that we have been closed. This will cause our |
| // destruction. |
| manager_->ReleaseOutputStream(this); |
| @@ -175,6 +180,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 +224,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_, |