Fix buffering problems in HEL mode.

oldstable
Ove Kaaven 2001-09-10 23:08:11 +00:00 committed by Alexandre Julliard
parent 909bcde294
commit fdebace998
2 changed files with 11 additions and 0 deletions

View File

@ -2047,6 +2047,11 @@ static HRESULT WINAPI IDirectSoundImpl_CreateSoundBuffer(
primarybuf->dsbd.dwFlags = dsbd->dwFlags;
return DS_OK;
} /* Else create primary buffer */
} else {
if (dsbd->dwBufferBytes < DSBSIZE_MIN || dsbd->dwBufferBytes > DSBSIZE_MAX) {
ERR("invalid sound buffer size %ld\n", dsbd->dwBufferBytes);
return DSERR_INVALIDPARAM; /* FIXME: which error? */
}
}
*ippdsb = (IDirectSoundBufferImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectSoundBufferImpl));
@ -3215,6 +3220,10 @@ static void CALLBACK DSOUND_timer(UINT timerID, UINT msg, DWORD dwUser, DWORD dw
} else mixq = 0;
if (forced) mixq = DS_SND_QUEUE;
/* Make sure that we don't rewrite any fragments that have already been
written and are waiting to be played */
mixq = (dsound->pwqueue > mixq) ? 0 : (mixq - dsound->pwqueue);
/* output it */
for (; mixq; mixq--) {
waveOutWrite(dsound->hwo, dsound->pwave[dsound->pwwrite], sizeof(WAVEHDR));

View File

@ -130,6 +130,8 @@ typedef struct _DSCAPS
#define DSBCAPS_GETCURRENTPOSITION2 0x00010000 /* More accurate play cursor under emulation*/
#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
#define DSBSIZE_MIN 4
#define DSBSIZE_MAX 0xFFFFFFF
#define DSBPAN_LEFT -10000
#define DSBPAN_RIGHT 10000
#define DSBVOLUME_MAX 0