Fix #17230: Dummy audio output class

This commit is contained in:
Abdurrahmaan Iqbal
2019-10-17 23:13:17 +01:00
committed by abcdefg30
parent 70b1df6ce7
commit 72eb4e1749
6 changed files with 91 additions and 2 deletions

View File

@@ -9,6 +9,7 @@
*/
#endregion
using System;
using OpenRA.Primitives;
namespace OpenRA.Platforms.Default
@@ -22,7 +23,15 @@ namespace OpenRA.Platforms.Default
public ISoundEngine CreateSound(string device)
{
return new OpenAlSoundEngine(device);
try
{
return new OpenAlSoundEngine(device);
}
catch (InvalidOperationException e)
{
Log.Write("sound", "Failed to initialize OpenAL device. Error was {0}", e);
return new DummySoundEngine(device);
}
}
public IFont CreateFont(byte[] data)