Updated to the latest version of NVorbis, fixed OggStream.Empty() failing to unqueue buffers when quitting due to a modified ALHelper.Check method that doesn't throw an exception on error

This commit is contained in:
Regalis
2016-12-31 14:49:43 +02:00
parent 9a69126b1c
commit a2d6b4890e
11 changed files with 906 additions and 127 deletions

View File

@@ -29,6 +29,7 @@ namespace Barotrauma.Sounds
try
{
AC = new AudioContext();
ALHelper.Check();
}
catch (DllNotFoundException e)
{
@@ -266,21 +267,28 @@ namespace Barotrauma.Sounds
{
var state = OpenTK.Audio.OpenAL.AL.GetSourceState(alSources[i]);
if (state == OpenTK.Audio.OpenAL.ALSourceState.Playing || state == OpenTK.Audio.OpenAL.ALSourceState.Paused)
{
Stop(i);
}
OpenTK.Audio.OpenAL.AL.DeleteSource(alSources[i]);
ALHelper.Check();
}
if (oggStream!=null)
if (oggStream != null)
{
oggStream.Stop();
oggStream.Dispose();
oggStream = null;
}
if (oggStreamer != null)
{
oggStreamer.Dispose();
oggStreamer = null;
}
}
}