From 22292df53bba2959f3891efc84f3e081c8d47d1f Mon Sep 17 00:00:00 2001 From: "phoglund@webrtc.org" Date: Tue, 8 Jul 2014 11:39:19 +0000 Subject: [PATCH] Adding explicit check for using dummy file devices. Calling into the file device factory without being compiled with file devices makes no sense and would cause hard-to-debug errors. Therefore I'm adding an explicit check so this isn't allowed. R=henrika@webrtc.org Review URL: https://webrtc-codereview.appspot.com/13849004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6621 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../modules/audio_device/dummy/file_audio_device_factory.cc | 6 ++++++ 1 file changed, 6 insertions(+) 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 db35bf111b..8c276f3e4f 100644 --- a/webrtc/modules/audio_device/dummy/file_audio_device_factory.cc +++ b/webrtc/modules/audio_device/dummy/file_audio_device_factory.cc @@ -32,6 +32,12 @@ FileAudioDevice* FileAudioDeviceFactory::CreateFileAudioDevice( void FileAudioDeviceFactory::SetFilenamesToUse( const char* inputAudioFilename, const char* outputAudioFilename) { +#ifndef WEBRTC_DUMMY_FILE_DEVICES + // Sanity: must be compiled with the right define to run this. + printf("Trying to use dummy file devices, but is not compiled " + "with WEBRTC_DUMMY_FILE_DEVICES. Bailing out.\n"); + exit(1); +#endif assert(strlen(inputAudioFilename) < MAX_FILENAME_LEN && strlen(outputAudioFilename) < MAX_FILENAME_LEN);