From 98808e3cf36631b7bb1b740f0b8eaa5ca0e6192a Mon Sep 17 00:00:00 2001 From: Antti Harri Date: Mon, 30 May 2011 23:57:14 +0300 Subject: [PATCH 1/3] Fix OGG reporting for the CD audio backend and tweak one test to be better. --- config.d/cdrom.m4 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/config.d/cdrom.m4 b/config.d/cdrom.m4 index 7abb70e4e..a2459b9be 100644 --- a/config.d/cdrom.m4 +++ b/config.d/cdrom.m4 @@ -14,13 +14,14 @@ if test "x$mingw" != xyes -a "x$enable_xmms" == xyes; then fi AC_SUBST(CD_CFLAGS) + +CDTYPE="" CD_CFLAGS="" +CD_PLUGIN_TARGETS="" if test "x$HAVE_VORBIS" = xyes; then - CD_PLUGIN_TARGETS="cd_file.la" -else - CD_PLUGIN_TARGETS="" + CDTYPE=" OGG" + CD_PLUGIN_TARGETS="cd_file.la" fi -unset CDTYPE AC_MSG_CHECKING(for CD audio support) @@ -74,7 +75,7 @@ QF_maGiC_VALUE CDTYPE="$CDTYPE WIN32" CD_PLUGIN_TARGETS="$CD_PLUGIN_TARGETS cd_win.la" ) -if test "$CDTYPE"; then +if test "x$CDTYPE" != "x"; then AC_MSG_RESULT([$CDTYPE]) else AC_MSG_RESULT([no]) From 67c7796c0b72cc20861b4a57e87ab64cea38f1d8 Mon Sep 17 00:00:00 2001 From: Antti Harri Date: Tue, 31 May 2011 00:05:35 +0300 Subject: [PATCH 2/3] Change default music backend from OGG to CD. --- libs/audio/cd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/audio/cd.c b/libs/audio/cd.c index 57f53537f..52c0e7585 100644 --- a/libs/audio/cd.c +++ b/libs/audio/cd.c @@ -95,7 +95,7 @@ VISIBLE int CDAudio_Init (void) { PI_RegisterPlugins (cd_plugin_list); - cd_plugin = Cvar_Get ("cd_plugin", "file", CVAR_ROM, NULL, + cd_plugin = Cvar_Get ("cd_plugin", "sdl", CVAR_ROM, NULL, "CD Plugin to use"); if (COM_CheckParm ("-nocdaudio")) From 8d1bd58adee581f63d458b6a6e9f5f84bce943cc Mon Sep 17 00:00:00 2001 From: Antti Harri Date: Sat, 4 Jun 2011 09:47:15 +0300 Subject: [PATCH 3/3] snd_dma.c fixes for non-power-of-two values. From Jacob Meuser. --- libs/audio/renderer/snd_dma.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/libs/audio/renderer/snd_dma.c b/libs/audio/renderer/snd_dma.c index 77caad8e6..99551acb0 100644 --- a/libs/audio/renderer/snd_dma.c +++ b/libs/audio/renderer/snd_dma.c @@ -75,14 +75,16 @@ static snd_output_funcs_t *snd_output_funcs; static void s_xfer_paint_buffer (int endtime) { - int count, out_idx, out_mask, step, val; + int count, out_idx, out_max, step, val; float snd_vol; float *p; p = (float *) snd_paintbuffer; count = (endtime - snd_paintedtime) * snd_shm->channels; - out_mask = (snd_shm->frames * snd_shm->channels) - 1; - out_idx = (snd_paintedtime * snd_shm->channels) & out_mask; + out_max = (snd_shm->frames * snd_shm->channels) - 1; + out_idx = snd_paintedtime * snd_shm->channels; + while (out_idx > out_max) + out_idx -= out_max + 1; step = 3 - snd_shm->channels; snd_vol = snd_volume->value; @@ -96,8 +98,9 @@ s_xfer_paint_buffer (int endtime) val = 0x7fff; else if (val < -0x8000) val = -0x8000; - out[out_idx] = val; - out_idx = (out_idx + 1) & out_mask; + out[out_idx++] = val; + if (out_idx > out_max) + out_idx = 0; } } else if (snd_shm->samplebits == 8) { unsigned char *out = (unsigned char *) snd_shm->buffer; @@ -109,8 +112,9 @@ s_xfer_paint_buffer (int endtime) val = 0x7f; else if (val < -0x80) val = -0x80; - out[out_idx] = val + 0x80; - out_idx = (out_idx + 1) & out_mask; + out[out_idx++] = val + 0x80; + if (out_idx > out_max) + out_idx = 0; } } }