Merge pull request #3769 from birarda/plugs

add guard for handling of local audio
This commit is contained in:
Philip Rosedale 2014-11-10 17:20:19 -08:00
commit 885a93b7e3

View file

@ -1345,8 +1345,11 @@ void Audio::handleAudioByteArray(const QByteArray& audioByteArray, const AudioIn
QAudioOutput* localSoundOutput = new QAudioOutput(getNamedAudioDeviceForMode(QAudio::AudioOutput, _outputAudioDeviceName), localFormat, this);
QIODevice* localIODevice = localSoundOutput->start();
qDebug() << "Writing" << audioByteArray.size() << "to" << localIODevice;
localIODevice->write(audioByteArray);
if (localIODevice) {
localIODevice->write(audioByteArray);
} else {
qDebug() << "Unable to handle audio byte array. Error:" << localSoundOutput->error();
}
} else {
qDebug() << "Audio::handleAudioByteArray called with an empty byte array. Sound is likely still downloading.";
}