diff --git a/src/modules/audio_device/main/source/audio_device_utility.cc b/src/modules/audio_device/main/source/audio_device_utility.cc index a01ba2e5b..c256f9e3e 100644 --- a/src/modules/audio_device/main/source/audio_device_utility.cc +++ b/src/modules/audio_device/main/source/audio_device_utility.cc @@ -69,42 +69,28 @@ namespace webrtc void AudioDeviceUtility::WaitForKey() { -struct termios oldt, newt; + struct termios oldt, newt; -int ch; + tcgetattr( STDIN_FILENO, &oldt ); + // we don't want getchar to echo! + newt = oldt; + newt.c_lflag &= ~( ICANON | ECHO ); + tcsetattr( STDIN_FILENO, TCSANOW, &newt ); -tcgetattr( STDIN_FILENO, &oldt ); + // catch any newline that's hanging around... + // you'll have to hit enter twice if you + // choose enter out of all available keys -// we don't want getchar to echo! + if (getchar() == '\n') + { + getchar(); + } -newt = oldt; - -newt.c_lflag &= ~( ICANON | ECHO ); - -tcsetattr( STDIN_FILENO, TCSANOW, &newt ); - - - -// catch any newline that's hanging around... - -// you'll have to hit enter twice if you - -// choose enter out of all available keys - -if (getchar() == '\n') - -{ - - ch = getchar(); - -} - - -tcsetattr( STDIN_FILENO, TCSANOW, &oldt ); + tcsetattr( STDIN_FILENO, TCSANOW, &oldt ); } WebRtc_UWord32 AudioDeviceUtility::GetTimeInMS()