dsound: Remove some more unused variables.

This commit is contained in:
Maarten Lankhorst 2007-07-06 22:57:48 +02:00 committed by Alexandre Julliard
parent 3252d093fc
commit 2b8a1815e6
3 changed files with 17 additions and 26 deletions

View File

@ -355,7 +355,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_Stop(LPDIRECTSOUNDBUFFER8 iface)
else
This->state = STATE_STOPPED;
}
DSOUND_CheckEvent(This, 0);
DSOUND_CheckEvent(This, 0, 0);
LeaveCriticalSection(&(This->lock));
/* **** */
@ -1030,8 +1030,6 @@ HRESULT IDirectSoundBufferImpl_Create(
dsb->lpVtbl = &dsbvt;
dsb->iks = NULL;
dsb->remix_pos = 0;
/* size depends on version */
CopyMemory(&dsb->dsbd, dsbd, dsbd->dwSize);
@ -1135,7 +1133,6 @@ HRESULT IDirectSoundBufferImpl_Create(
/* It's not necessary to initialize values to zero since */
/* we allocated this structure with HEAP_ZERO_MEMORY... */
dsb->playpos = 0;
dsb->buf_mixpos = 0;
dsb->state = STATE_STOPPED;
@ -1285,7 +1282,6 @@ HRESULT IDirectSoundBufferImpl_Duplicate(
dsb->ref = 0;
dsb->state = STATE_STOPPED;
dsb->playpos = 0;
dsb->buf_mixpos = 0;
dsb->device = device;
dsb->ds3db = NULL;

View File

@ -162,7 +162,7 @@ struct IDirectSoundBufferImpl
PWAVEFORMATEX pwfx;
BufferMemory* buffer;
DWORD playflags,state,leadin;
DWORD playpos,startpos,writelead,buflen;
DWORD startpos,writelead,buflen;
DWORD nAvgBytesPerSec;
DWORD freq;
DSVOLUMEPAN volpan;
@ -170,7 +170,7 @@ struct IDirectSoundBufferImpl
/* used for frequency conversion (PerfectPitch) */
ULONG freqAdjust, freqAcc;
/* used for intelligent (well, sort of) prebuffering */
DWORD primary_mixpos, buf_mixpos, last_playpos, remix_pos;
DWORD primary_mixpos, buf_mixpos, last_playpos;
/* IDirectSoundNotifyImpl fields */
IDirectSoundNotifyImpl* notify;
@ -433,7 +433,7 @@ DWORD DSOUND_CalcPlayPosition(IDirectSoundBufferImpl *This, DWORD pplay, DWORD p
/* mixer.c */
void DSOUND_CheckEvent(IDirectSoundBufferImpl *dsb, int len);
void DSOUND_CheckEvent(IDirectSoundBufferImpl *dsb, DWORD playpos, int len);
void DSOUND_RecalcVolPan(PDSVOLUMEPAN volpan);
void DSOUND_AmpFactorToVolPan(PDSVOLUMEPAN volpan);
void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb);

View File

@ -106,7 +106,7 @@ void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb)
* "last played" position for the buffer (i.e. dsb->playpos) and "len" bytes
* beyond that position.
*/
void DSOUND_CheckEvent(IDirectSoundBufferImpl *dsb, int len)
void DSOUND_CheckEvent(IDirectSoundBufferImpl *dsb, DWORD playpos, int len)
{
int i;
DWORD offset;
@ -117,7 +117,7 @@ void DSOUND_CheckEvent(IDirectSoundBufferImpl *dsb, int len)
return;
TRACE("(%p) buflen = %d, playpos = %d, len = %d\n",
dsb, dsb->buflen, dsb->playpos, len);
dsb, dsb->buflen, playpos, len);
for (i = 0; i < dsb->nrofnotifies ; i++) {
event = dsb->notifies + i;
offset = event->dwOffset;
@ -136,14 +136,14 @@ void DSOUND_CheckEvent(IDirectSoundBufferImpl *dsb, int len)
} else
return;
}
if ((dsb->playpos + len) >= dsb->buflen) {
if ((offset < ((dsb->playpos + len) % dsb->buflen)) ||
(offset >= dsb->playpos)) {
if ((playpos + len) >= dsb->buflen) {
if ((offset < ((playpos + len) % dsb->buflen)) ||
(offset >= playpos)) {
TRACE("signalled event %p (%d)\n", event->hEventNotify, i);
SetEvent(event->hEventNotify);
}
} else {
if ((offset >= dsb->playpos) && (offset < (dsb->playpos + len))) {
if ((offset >= playpos) && (offset < (playpos + len))) {
TRACE("signalled event %p (%d)\n", event->hEventNotify, i);
SetEvent(event->hEventNotify);
}
@ -594,15 +594,6 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD playpos, DWORD wri
TRACE("writepos=%d, buf_mixpos=%d, primary_mixpos=%d, mixlen=%d\n", writepos, dsb->buf_mixpos, dsb->primary_mixpos, mixlen);
TRACE("looping=%d, startpos=%d, leadin=%d, buflen=%d\n", dsb->playflags, dsb->startpos, dsb->leadin, dsb->buflen);
/* check for notification positions */
if (dsb->dsbd.dwFlags & DSBCAPS_CTRLPOSITIONNOTIFY &&
dsb->state != STATE_STARTING) {
DSOUND_CheckEvent(dsb, mixlen);
}
/* save write position for non-GETCURRENTPOSITION2... */
dsb->playpos = writepos;
/* calculate how much pre-buffering has already been done for this buffer */
primary_done = DSOUND_BufPtrDiff(dsb->device->buflen, dsb->primary_mixpos, writepos);
@ -627,6 +618,12 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD playpos, DWORD wri
/* mix more data */
mixlen = DSOUND_MixInBuffer(dsb, dsb->primary_mixpos, mixlen);
/* check for notification positions */
if (dsb->dsbd.dwFlags & DSBCAPS_CTRLPOSITIONNOTIFY &&
dsb->state != STATE_STARTING) {
DSOUND_CheckEvent(dsb, writepos, mixlen);
}
/* increase mix position */
dsb->primary_mixpos += mixlen;
dsb->primary_mixpos %= dsb->device->buflen;
@ -644,10 +641,8 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD playpos, DWORD wri
TRACE("Buffer reached end. Stopped\n");
dsb->state = STATE_STOPPED;
dsb->playpos = 0;
dsb->buf_mixpos = 0;
dsb->leadin = FALSE;
DSOUND_CheckEvent(dsb, mixlen);
}
/* Report back the total prebuffered amount for this buffer */
@ -692,7 +687,7 @@ static DWORD DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD playpos,
/* if buffer is stopping it is stopped now */
if (dsb->state == STATE_STOPPING) {
dsb->state = STATE_STOPPED;
DSOUND_CheckEvent(dsb, 0);
DSOUND_CheckEvent(dsb, 0, 0);
} else {
/* if recovering, reset the mix position */