mirror of
https://github.com/raysan5/raylib.git
synced 2026-02-07 06:39:17 -05:00
logic bug fix
This commit is contained in:
@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user