1
0
Fork 0

Avoid OpenAL context conflict by switching sound device

This commit is contained in:
Clément de l'Hamaide 2013-08-22 17:06:04 +02:00
parent 7af288d919
commit cd41a649ec

View file

@ -356,7 +356,13 @@
if (cmp(current, new) != 0) {
setprop("sim/sound/devices/name", new);
setprop("sim/sound/device-name", new);
fgcommand("reinit", props.Node.new({ "subsystem" : "sound" }));
if(getprop("/sim/fgcom/enabled")) {
setprop("/sim/fgcom/enabled", 0);
settimer( func { fgcommand("reinit", props.Node.new({ "subsystem" : "sound" })); }, 0.5 );
settimer( func { setprop("/sim/fgcom/enabled", 1); print("enable fgcom");}, 1 );
} else {
fgcommand("reinit", props.Node.new({ "subsystem" : "sound" }));
}
}
}