mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
add a guard in case local audio cannot be handled
This commit is contained in:
parent
fda5b0fffd
commit
dabc2b23a3
1 changed files with 5 additions and 2 deletions
|
@ -1342,8 +1342,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.";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue