(e95dff16f) SoundChannel.IsPlaying error tolerance

This commit is contained in:
Joonas Rikkonen
2019-06-16 18:06:04 +03:00
parent 92638d87f3
commit d13776b4dd
2 changed files with 3 additions and 1 deletions

View File

@@ -325,7 +325,9 @@ namespace Barotrauma.Sounds
if (ALSourceIndex < 0) return false;
if (IsStream && !reachedEndSample) return true;
int state;
Al.GetSourcei(Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex), Al.SourceState, out state);
uint alSource = Sound.Owner.GetSourceFromIndex(Sound.SourcePoolIndex, ALSourceIndex);
if (!Al.IsSource(alSource)) return false;
Al.GetSourcei(alSource, Al.SourceState, out state);
bool playing = state == Al.Playing;
int alError = Al.GetError();
if (alError != Al.NoError)

Binary file not shown.