diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc b/media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc index cd9f4754a176..6f9e35f34847 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc +++ b/media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc @@ -2369,18 +2369,16 @@ bool AudioDeviceLinuxALSA::RecThreadProcess() bool AudioDeviceLinuxALSA::KeyPressed() const{ - +#ifdef USE_X11 char szKey[32]; unsigned int i = 0; char state = 0; -#ifdef USE_X11 if (!_XDisplay) return false; // Check key map status XQueryKeymap(_XDisplay, szKey); -#endif // A bit change in keymap means a key is pressed for (i = 0; i < sizeof(szKey); i++) @@ -2389,5 +2387,8 @@ bool AudioDeviceLinuxALSA::KeyPressed() const{ // Save old state memcpy((char*)_oldKeyState, (char*)szKey, sizeof(_oldKeyState)); return (state != 0); +#else + return false; +#endif } } // namespace webrtc diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc b/media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc index 3f4c8f3c9234..370635854cfb 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc +++ b/media/webrtc/trunk/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc @@ -3114,18 +3114,16 @@ bool AudioDeviceLinuxPulse::RecThreadProcess() } bool AudioDeviceLinuxPulse::KeyPressed() const{ - +#ifdef USE_X11 char szKey[32]; unsigned int i = 0; char state = 0; -#ifdef USE_X11 if (!_XDisplay) return false; // Check key map status XQueryKeymap(_XDisplay, szKey); -#endif // A bit change in keymap means a key is pressed for (i = 0; i < sizeof(szKey); i++) @@ -3134,5 +3132,8 @@ bool AudioDeviceLinuxPulse::KeyPressed() const{ // Save old state memcpy((char*)_oldKeyState, (char*)szKey, sizeof(_oldKeyState)); return (state != 0); +#else + return false; +#endif } }