dsound: Remove unneeded casts.
This commit is contained in:
parent
a5195512c9
commit
2cf2807052
|
@ -376,7 +376,7 @@ DirectSoundCaptureEnumerateW(
|
||||||
wDesc, sizeof(wDesc)/sizeof(WCHAR) );
|
wDesc, sizeof(wDesc)/sizeof(WCHAR) );
|
||||||
MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1,
|
MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1,
|
||||||
wName, sizeof(wName)/sizeof(WCHAR) );
|
wName, sizeof(wName)/sizeof(WCHAR) );
|
||||||
if (lpDSEnumCallback((LPGUID)&DSOUND_capture_guids[wid], wDesc, wName, lpContext) == FALSE)
|
if (lpDSEnumCallback(&DSOUND_capture_guids[wid], wDesc, wName, lpContext) == FALSE)
|
||||||
return DS_OK;
|
return DS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -418,7 +418,7 @@ DSOUND_capture_callback(
|
||||||
DWORD dw2 )
|
DWORD dw2 )
|
||||||
{
|
{
|
||||||
DirectSoundCaptureDevice * This = (DirectSoundCaptureDevice*)dwUser;
|
DirectSoundCaptureDevice * This = (DirectSoundCaptureDevice*)dwUser;
|
||||||
IDirectSoundCaptureBufferImpl * Moi = (IDirectSoundCaptureBufferImpl*) This->capture_buffer;
|
IDirectSoundCaptureBufferImpl * Moi = This->capture_buffer;
|
||||||
TRACE("(%p,%08x(%s),%08x,%08x,%08x) entering at %d\n",hwi,msg,
|
TRACE("(%p,%08x(%s),%08x,%08x,%08x) entering at %d\n",hwi,msg,
|
||||||
msg == MM_WIM_OPEN ? "MM_WIM_OPEN" : msg == MM_WIM_CLOSE ? "MM_WIM_CLOSE" :
|
msg == MM_WIM_OPEN ? "MM_WIM_OPEN" : msg == MM_WIM_CLOSE ? "MM_WIM_CLOSE" :
|
||||||
msg == MM_WIM_DATA ? "MM_WIM_DATA" : "UNKNOWN",dwUser,dw1,dw2,GetTickCount());
|
msg == MM_WIM_DATA ? "MM_WIM_DATA" : "UNKNOWN",dwUser,dw1,dw2,GetTickCount());
|
||||||
|
@ -1388,7 +1388,7 @@ HRESULT IDirectSoundCaptureBufferImpl_Create(
|
||||||
HRESULT err = DS_OK;
|
HRESULT err = DS_OK;
|
||||||
LPBYTE newbuf;
|
LPBYTE newbuf;
|
||||||
DWORD buflen;
|
DWORD buflen;
|
||||||
IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)*ppobj;
|
IDirectSoundCaptureBufferImpl *This = *ppobj;
|
||||||
|
|
||||||
This->ref = 1;
|
This->ref = 1;
|
||||||
This->device = device;
|
This->device = device;
|
||||||
|
|
|
@ -1560,7 +1560,7 @@ HRESULT DirectSoundDevice_CreateSoundBuffer(
|
||||||
if (device->hwbuf)
|
if (device->hwbuf)
|
||||||
device->dsbd.dwFlags |= DSBCAPS_LOCHARDWARE;
|
device->dsbd.dwFlags |= DSBCAPS_LOCHARDWARE;
|
||||||
else device->dsbd.dwFlags |= DSBCAPS_LOCSOFTWARE;
|
else device->dsbd.dwFlags |= DSBCAPS_LOCSOFTWARE;
|
||||||
hres = PrimaryBufferImpl_Create(device, (PrimaryBufferImpl**)&(device->primary), &(device->dsbd));
|
hres = PrimaryBufferImpl_Create(device, &(device->primary), &(device->dsbd));
|
||||||
if (device->primary) {
|
if (device->primary) {
|
||||||
IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER8)(device->primary));
|
IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER8)(device->primary));
|
||||||
*ppdsb = (LPDIRECTSOUNDBUFFER)(device->primary);
|
*ppdsb = (LPDIRECTSOUNDBUFFER)(device->primary);
|
||||||
|
@ -1628,12 +1628,12 @@ HRESULT DirectSoundDevice_CreateSoundBuffer(
|
||||||
return DSERR_INVALIDPARAM;
|
return DSERR_INVALIDPARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = IDirectSoundBufferImpl_Create(device, (IDirectSoundBufferImpl**)&dsb, dsbd);
|
hres = IDirectSoundBufferImpl_Create(device, &dsb, dsbd);
|
||||||
if (dsb) {
|
if (dsb) {
|
||||||
hres = SecondaryBufferImpl_Create(dsb, (SecondaryBufferImpl**)ppdsb);
|
hres = SecondaryBufferImpl_Create(dsb, (SecondaryBufferImpl**)ppdsb);
|
||||||
if (*ppdsb) {
|
if (*ppdsb) {
|
||||||
dsb->secondary = (SecondaryBufferImpl*)*ppdsb;
|
dsb->secondary = (SecondaryBufferImpl*)*ppdsb;
|
||||||
IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER)*ppdsb);
|
IDirectSoundBuffer_AddRef(*ppdsb);
|
||||||
} else
|
} else
|
||||||
WARN("SecondaryBufferImpl_Create failed\n");
|
WARN("SecondaryBufferImpl_Create failed\n");
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -445,11 +445,11 @@ static LPBYTE DSOUND_MixerVol(const IDirectSoundBufferImpl *dsb, DWORD writepos,
|
||||||
/* 8-bit WAV is unsigned, but we need to operate */
|
/* 8-bit WAV is unsigned, but we need to operate */
|
||||||
/* on signed data for this to work properly */
|
/* on signed data for this to work properly */
|
||||||
for (i = 0; i < len; i+=2) {
|
for (i = 0; i < len; i+=2) {
|
||||||
*(bpc++) = (((INT)(*(mem++) - 128) * vLeft) >> 16) + 128;
|
*(bpc++) = (((*(mem++) - 128) * vLeft) >> 16) + 128;
|
||||||
*(bpc++) = (((INT)(*(mem++) - 128) * vRight) >> 16) + 128;
|
*(bpc++) = (((*(mem++) - 128) * vRight) >> 16) + 128;
|
||||||
}
|
}
|
||||||
if (len % 2 == 1 && nChannels == 1)
|
if (len % 2 == 1 && nChannels == 1)
|
||||||
*(bpc++) = (((INT)(*(mem++) - 128) * vLeft) >> 16) + 128;
|
*(bpc++) = (((*(mem++) - 128) * vLeft) >> 16) + 128;
|
||||||
break;
|
break;
|
||||||
case 16:
|
case 16:
|
||||||
/* 16-bit WAV is signed -- much better */
|
/* 16-bit WAV is signed -- much better */
|
||||||
|
|
Loading…
Reference in New Issue