From: kosmirror <kos...@us...> - 2025-05-23 02:09:21
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 35d77329f77d75bf74343614fede778fea026ec9 (commit) via c2327bd77f36f98ba02d7e17eb3b6dccdf6ba9c1 (commit) from 138477b71b164d466023a29e316631f3e0bfcaef (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 35d77329f77d75bf74343614fede778fea026ec9 Author: QuzarDC <qu...@co...> Date: Thu May 22 21:54:28 2025 -0400 Remove double-init of streams in multi-stream example. commit c2327bd77f36f98ba02d7e17eb3b6dccdf6ba9c1 Author: QuzarDC <qu...@co...> Date: Thu May 22 21:50:32 2025 -0400 Prevent double-init of snd_stream. Without this protection, there would be a memory leak caused by separation buffers being allocated multiple times. ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/sound/multi-stream/main.c | 1 - kernel/arch/dreamcast/sound/snd_stream.c | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/dreamcast/sound/multi-stream/main.c b/examples/dreamcast/sound/multi-stream/main.c index 4758bfab..2635afed 100644 --- a/examples/dreamcast/sound/multi-stream/main.c +++ b/examples/dreamcast/sound/multi-stream/main.c @@ -28,7 +28,6 @@ int main(int argc, char **argv) { vid_set_mode(DM_640x480, PM_RGB555); // Initialize sound system and WAV - snd_stream_init(); wav_init(); wav_stream_hnd_t faucet = wav_create("/rd/faucet.wav", LOOP); diff --git a/kernel/arch/dreamcast/sound/snd_stream.c b/kernel/arch/dreamcast/sound/snd_stream.c index 7f51a9f4..6275f2dd 100644 --- a/kernel/arch/dreamcast/sound/snd_stream.c +++ b/kernel/arch/dreamcast/sound/snd_stream.c @@ -322,6 +322,12 @@ int snd_stream_init(void) { } int snd_stream_init_ex(int channels, size_t buffer_size) { + + if(!sep_buffer[0]) { + dbglog(DBG_ERROR, "snd_stream_init_ex(): already initialized\n"); + return -1; + } + max_channels = channels; if(buffer_size > 0) { hooks/post-receive -- A pseudo Operating System for the Dreamcast. |