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

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

Issue 1613073004: Changes error handling for AudioUnitRender on Mac OSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_low_latency_input_mac.cc
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
index eb328af660213876037eed230865b7e8ca124133..9baaf2701caf34e33d1e442554c9260666ed80e6 100644
--- a/media/audio/mac/audio_low_latency_input_mac.cc
+++ b/media/audio/mac/audio_low_latency_input_mac.cc
@@ -586,9 +586,7 @@ OSStatus AUAudioInputStream::InputProc(void* user_data,
if (result) {
UMA_HISTOGRAM_SPARSE_SLOWLY("Media.AudioInputCbErrorMac", result);
OSSTATUS_DLOG(ERROR, result) << "AudioUnitRender() failed ";
- if (result != kAudioUnitErr_TooManyFramesToProcess) {
- audio_input->HandleError(result);
- } else {
+ if (result == kAudioUnitErr_TooManyFramesToProcess) {
DCHECK(!audio_input->last_success_time_.is_null());
// We delay stopping the stream for kAudioUnitErr_TooManyFramesToProcess
// since it has been observed that some USB headsets can cause this error
@@ -604,6 +602,18 @@ OSStatus AUAudioInputStream::InputProc(void* user_data,
DLOG(ERROR) << "Too long sequence of TooManyFramesToProcess errors!";
audio_input->HandleError(result);
}
+ } else if (result == kAudioUnitErr_CannotDoInCurrentContext) {
+ // Returned when an audio unit is in a state where it can't perform the
+ // requested action now - but it could later.
+ // TODO(henrika): figure out why we see this error message.
+ DLOG(ERROR) << "kAudioUnitErr_CannotDoInCurrentContext";
tommi (sloooow) - chröme 2016/01/21 12:36:12 maybe LOG(ERROR) for now? In case this could be u
tommi (sloooow) - chröme 2016/01/21 12:42:42 what about this comment?
henrika (OOO until Aug 14) 2016/01/21 12:44:13 Done. Changed some more to LOG as well. To ensure
henrika (OOO until Aug 14) 2016/01/21 12:53:08 Done.
+ } else if (result == kAudioUnitErr_NoConnection) {
+ // There is no connection (generally an audio unit is asked to render
+ // but it has not input from which to gather data).
+ // TODO(henrika): figure out why we see this error message.
+ DLOG(ERROR) << "kAudioUnitErr_NoConnection";
tommi (sloooow) - chröme 2016/01/21 12:36:12 I think we should treat this one like a general ca
tommi (sloooow) - chröme 2016/01/21 12:42:42 LOG(ERROR) could be useful for this error as well
henrika (OOO until Aug 14) 2016/01/21 12:44:13 Done.
henrika (OOO until Aug 14) 2016/01/21 12:53:08 It is covered above by OSSTATUS_DLOG(ERROR, result
+ } else {
+ audio_input->HandleError(result);
}
return result;
}
« 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