diff --git a/webrtc/modules/audio_device/audio_device_impl.cc b/webrtc/modules/audio_device/audio_device_impl.cc index f7fc6234b3..850e9f3db9 100644 --- a/webrtc/modules/audio_device/audio_device_impl.cc +++ b/webrtc/modules/audio_device/audio_device_impl.cc @@ -186,7 +186,13 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() { LOG(INFO) << "Dummy Audio APIs will be utilized"; #elif defined(WEBRTC_DUMMY_FILE_DEVICES) ptrAudioDevice = FileAudioDeviceFactory::CreateFileAudioDevice(Id()); - LOG(INFO) << "Will use file-playing dummy device."; + if (ptrAudioDevice) { + LOG(INFO) << "Will use file-playing dummy device."; + } else { + // Create a dummy device instead. + ptrAudioDevice = new AudioDeviceDummy(Id()); + LOG(INFO) << "Dummy Audio APIs will be utilized"; + } #else AudioLayer audioLayer(PlatformAudioLayer()); diff --git a/webrtc/modules/audio_device/dummy/file_audio_device_factory.cc b/webrtc/modules/audio_device/dummy/file_audio_device_factory.cc index 7c6d16f129..db9bad72dd 100644 --- a/webrtc/modules/audio_device/dummy/file_audio_device_factory.cc +++ b/webrtc/modules/audio_device/dummy/file_audio_device_factory.cc @@ -13,6 +13,7 @@ #include #include +#include "webrtc/base/logging.h" #include "webrtc/modules/audio_device/dummy/file_audio_device.h" namespace webrtc { @@ -24,10 +25,13 @@ char FileAudioDeviceFactory::_outputAudioFilename[MAX_FILENAME_LEN] = ""; FileAudioDevice* FileAudioDeviceFactory::CreateFileAudioDevice( const int32_t id) { // Bail out here if the files haven't been set explicitly. + // audio_device_impl.cc should then fall back to dummy audio. if (!_isConfigured) { - printf("Was compiled with WEBRTC_DUMMY_AUDIO_PLAY_STATIC_FILE " - "but did not set input/output files to use. Bailing out.\n"); - std::exit(1); + LOG(LS_WARNING) << "WebRTC configured with WEBRTC_DUMMY_FILE_DEVICES but " + << "no device files supplied. Will fall back to dummy " + << "audio."; + + return nullptr; } return new FileAudioDevice(id, _inputAudioFilename, _outputAudioFilename); }