From 7fcce036daa5514162d15fa33ffde255c6301977 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Mon, 30 Jul 2007 16:20:08 +0200 Subject: [PATCH] dsound: Add a registry setting for hel buffer length. --- dlls/dsound/dsound_main.c | 7 +++++++ dlls/dsound/dsound_private.h | 2 +- dlls/dsound/primary.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c index de849fec7d..497fa15606 100644 --- a/dlls/dsound/dsound_main.c +++ b/dlls/dsound/dsound_main.c @@ -53,6 +53,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound); +#define DS_HEL_BUFLEN 0x8000 /* HEL: The buffer length of the emulated buffer */ #define DS_SND_QUEUE_MAX 10 /* max number of fragments to prebuffer, each fragment is approximately 10 ms long */ DirectSoundDevice* DSOUND_renderer[MAXWAVEDRIVERS]; @@ -87,6 +88,7 @@ HRESULT mmErr(UINT err) } int ds_emuldriver = 0; +int ds_hel_buflen = DS_HEL_BUFLEN; int ds_snd_queue_max = DS_SND_QUEUE_MAX; int ds_hw_accel = DS_HW_ACCEL_FULL; int ds_default_playback = 0; @@ -144,6 +146,9 @@ void setup_dsound_options(void) if (!get_config_key( hkey, appkey, "EmulDriver", buffer, MAX_PATH )) ds_emuldriver = strcmp(buffer, "N"); + if (!get_config_key( hkey, appkey, "HelBuflen", buffer, MAX_PATH )) + ds_hel_buflen = atoi(buffer); + if (!get_config_key( hkey, appkey, "SndQueueMax", buffer, MAX_PATH )) ds_snd_queue_max = atoi(buffer); @@ -175,6 +180,8 @@ void setup_dsound_options(void) if (ds_emuldriver) WARN("ds_emuldriver = %d (default=0)\n",ds_emuldriver); + if (ds_hel_buflen != DS_HEL_BUFLEN) + WARN("ds_hel_buflen = %d (default=%d)\n",ds_hel_buflen ,DS_HEL_BUFLEN); if (ds_snd_queue_max != DS_SND_QUEUE_MAX) WARN("ds_snd_queue_max = %d (default=%d)\n",ds_snd_queue_max ,DS_SND_QUEUE_MAX); if (ds_hw_accel != DS_HW_ACCEL_FULL) diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index f55f46d1ff..98575e3288 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -23,7 +23,6 @@ #define DS_TIME_RES 2 /* Resolution of multimedia timer */ #define DS_TIME_DEL 10 /* Delay of multimedia timer callback, and duration of HEL fragment */ -#define DS_HEL_BUFLEN 0x8000 /* HEL: The buffer length of the emulated buffer */ #define DS_HEL_FRAGS 0x10 /* HEL only: number of waveOut fragments in primary buffer * (changing this won't help you) */ @@ -34,6 +33,7 @@ #define DS_HW_ACCEL_EMULATION 3 extern int ds_emuldriver; +extern int ds_hel_buflen; extern int ds_snd_queue_max; extern int ds_hw_accel; extern int ds_default_playback; diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 7b7b4644e3..dfcf10778f 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -88,7 +88,7 @@ static HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) /* on original windows, the buffer it set to a fixed size, no matter what the settings are. on windows this size is always fixed (tested on win-xp) */ - buflen = DS_HEL_BUFLEN; + buflen = ds_hel_buflen; TRACE("desired buflen=%d, old buffer=%p\n", buflen, device->buffer); -- 2.32.0.93.g670b81a890