dsound: Add a registry setting for hel buffer length.

This commit is contained in:
Maarten Lankhorst 2007-07-30 16:20:08 +02:00 committed by Alexandre Julliard
parent 5266e57975
commit 7fcce036da
3 changed files with 9 additions and 2 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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);