sdl12-compat: audio: Fixed undefined silence value in SDL_OpenAudio().

From 8f54fd8010551ef358eb5f5a22d294794b5e984f Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Tue, 14 Dec 2021 21:29:04 -0500
Subject: [PATCH] audio: Fixed undefined silence value in SDL_OpenAudio().

This gets rid of the popping sound in DOSBox, etc.

Fixes #122.
---
 src/SDL12_compat.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index 5411ee3..a291837 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -7888,6 +7888,9 @@ OpenSDL2AudioDevice(SDL_AudioSpec *want)
     want->userdata = orig_userdata;
     want->size = want->samples * want->channels * (SDL_AUDIO_BITSIZE(want->format) / 8);
 
+    /* note that 0x80 isn't perfect silence for U16 formats, but we only have one byte that is used for memset() calls, so it has to do. SDL2 has the same bug. */
+    want->silence = SDL_AUDIO_ISSIGNED(want->format) ? 0x00 : 0x80;
+
     /* reset audiostreams if device format changed. */
     FIXME("deal with failure in here");
     ResetAudioStreamForDeviceChange(&audio_cbdata->app_callback_stream, &audio_cbdata->app_callback_format);