diff --git a/src/multimedia/qqtaudiomanager.cpp b/src/multimedia/qqtaudiomanager.cpp index 9ab848a7..574a0269 100644 --- a/src/multimedia/qqtaudiomanager.cpp +++ b/src/multimedia/qqtaudiomanager.cpp @@ -41,14 +41,14 @@ void QQtAudioManager::startInput() { stopInput(); mInputManager = new QAudioInput ( mInputDeviceInfo, mInputAudioFormat, this ); - if ( QAudio::NoError != mInputManager->error() ) + mInputDevice = mInputManager->start(); + if ( !mInputDevice || QAudio::NoError != mInputManager->error() ) { pline() << mInputDeviceInfo.deviceName() << mInputAudioFormat.sampleSize() << mInputAudioFormat.sampleRate() << mInputAudioFormat.channelCount() << "open failed, errcode:" << mInputManager->error(); delete mInputManager; return; } - mInputDevice = mInputManager->start(); connect ( mInputDevice, SIGNAL ( readyRead() ), this, SIGNAL ( readyRead() ) ); } @@ -83,14 +83,14 @@ void QQtAudioManager::startOutput() { stopOutput(); mOutputManager = new QAudioOutput ( mOutputDeviceInfo, mOutputAudioFormat, this ); - if ( QAudio::NoError != mOutputManager->error() ) + mOutputDevice = mOutputManager->start(); + if ( !mOutputDevice || QAudio::NoError != mOutputManager->error() ) { pline() << mOutputDeviceInfo.deviceName() << mOutputAudioFormat.sampleSize() << mOutputAudioFormat.sampleRate() << mOutputAudioFormat.channelCount() << "open failed, errcode:" << mOutputManager->error(); delete mOutputManager; return; } - mOutputDevice = mOutputManager->start(); } void QQtAudioManager::stopOutput()