logic bug fix

This commit is contained in:
Joshua Reisenauer 2016-05-15 02:09:57 -07:00
parent d38d7a1bed
commit 86fbf4fd8f

View file

@ -999,7 +999,7 @@ static bool BufferMusicStream(int index)
if (!currentMusic[index].ctx->playing && currentMusic[index].totalSamplesLeft > 0)
{
UpdateAudioContext(currentMusic[index].ctx, NULL, 0);
return true; // it is still active, only it is paused
return true; // it is still active but it is paused
}
@ -1080,7 +1080,7 @@ void UpdateMusicStream(int index)
stb_vorbis_seek_start(currentMusic[index].stream);
currentMusic[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[index].stream) * currentMusic[index].ctx->channels;
}
active = BufferMusicStream(index);
active = true;
}
@ -1088,7 +1088,7 @@ void UpdateMusicStream(int index)
alGetSourcei(currentMusic[index].ctx->alSource, AL_SOURCE_STATE, &state);
if ((state != AL_PLAYING) && active) alSourcePlay(currentMusic[index].ctx->alSource);
if (state != AL_PLAYING && active && currentMusic[index].ctx->playing) alSourcePlay(currentMusic[index].ctx->alSource);
if (!active) StopMusicStream(index);