Chromium Code Reviews| 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 c034b61f9d1ee2627f18a2d2c85a3c9bd0267cc6..7819ae71b22b0861123b2e1884abd86008cce06f 100644 |
| --- a/media/audio/mac/audio_low_latency_input_mac.cc |
| +++ b/media/audio/mac/audio_low_latency_input_mac.cc |
| @@ -5,6 +5,7 @@ |
| #include "media/audio/mac/audio_low_latency_input_mac.h" |
| #include <CoreServices/CoreServices.h> |
| +#include <string> |
| #include "base/logging.h" |
| #include "base/mac/mac_logging.h" |
| @@ -586,7 +587,8 @@ OSStatus AUAudioInputStream::InputProc(void* user_data, |
| if (result) { |
| UMA_HISTOGRAM_SPARSE_SLOWLY("Media.AudioInputCbErrorMac", result); |
| OSSTATUS_LOG(ERROR, result) << "AudioUnitRender() failed "; |
| - if (result == kAudioUnitErr_TooManyFramesToProcess) { |
| + if (result == kAudioUnitErr_TooManyFramesToProcess || |
| + result == kAudioUnitErr_CannotDoInCurrentContext) { |
| 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 |
| @@ -599,7 +601,10 @@ OSStatus AUAudioInputStream::InputProc(void* user_data, |
| base::TimeTicks::Now() - audio_input->last_success_time_; |
| if ((time_since_last_success > |
| base::TimeDelta::FromSeconds(kMaxErrorTimeoutInSeconds))) { |
| - LOG(ERROR) << "Too long sequence of TooManyFramesToProcess errors!"; |
| + std::string err = (result == kAudioUnitErr_TooManyFramesToProcess) |
|
tommi (sloooow) - chröme
2016/01/21 15:09:20
const char*
|
| + ? "kAudioUnitErr_TooManyFramesToProcess" |
| + : "kAudioUnitErr_CannotDoInCurrentContext"; |
| + LOG(ERROR) << "Too long sequence of " << err << " errors!"; |
| audio_input->HandleError(result); |
| } |
| } else if (result == kAudioUnitErr_CannotDoInCurrentContext) { |
|
tommi (sloooow) - chröme
2016/01/21 15:09:20
this check is now superfluous, right?
|
| @@ -607,7 +612,7 @@ OSStatus AUAudioInputStream::InputProc(void* user_data, |
| // requested action now - but it could later. |
| // TODO(henrika): figure out why we see this error message; do nothing |
| // for now. Hoping that we will get back on track soon. |
| - LOG(ERROR) << "kAudioUnitErr_CannotDoInCurrentContext"; |
| + // LOG(ERROR) << "kAudioUnitErr_CannotDoInCurrentContext"; |
| } else { |
| // We have also seen kAudioUnitErr_NoConnection in some cases. Bailing |
| // out for this error for now. |