Skip to content

Commit

Permalink
Clear PCM buffer state when closing audio device (#2736)
Browse files Browse the repository at this point in the history
Fix for #2714
  • Loading branch information
veins1 authored Oct 2, 2022
1 parent 33e7f7c commit 2872b2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/raudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,9 @@ void CloseAudioDevice(void)

AUDIO.System.isReady = false;
RL_FREE(AUDIO.System.pcmBuffer);

AUDIO.System.pcmBuffer = NULL;
AUDIO.System.pcmBufferSize = 0;

TRACELOG(LOG_INFO, "AUDIO: Device closed successfully");
}
else TRACELOG(LOG_WARNING, "AUDIO: Device could not be closed, not currently initialized");
Expand Down

0 comments on commit 2872b2f

Please sign in to comment.