Merge pull request #7142 from howard-stearns/null-audio-injector

null audio injector
This commit is contained in:
Chris Collins 2016-02-19 11:32:01 -08:00
commit 1fe9bb2c6c

View file

@ -45,8 +45,11 @@ ScriptAudioInjector* AudioScriptingInterface::playSound(Sound* sound, const Audi
// stereo option isn't set from script, this comes from sound metadata or filename // stereo option isn't set from script, this comes from sound metadata or filename
AudioInjectorOptions optionsCopy = injectorOptions; AudioInjectorOptions optionsCopy = injectorOptions;
optionsCopy.stereo = sound->isStereo(); optionsCopy.stereo = sound->isStereo();
auto injector = AudioInjector::playSound(sound->getByteArray(), optionsCopy, _localAudioInterface);
return new ScriptAudioInjector(AudioInjector::playSound(sound->getByteArray(), optionsCopy, _localAudioInterface)); if (!injector) {
return NULL;
}
return new ScriptAudioInjector(injector);
} else { } else {
qCDebug(scriptengine) << "AudioScriptingInterface::playSound called with null Sound object."; qCDebug(scriptengine) << "AudioScriptingInterface::playSound called with null Sound object.";