mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-15 11:07:17 +00:00
dsound: Avoid division by zero when calculating Doppler shift.
This commit is contained in:
parent
feaaa5bcc3
commit
64cdecc632
|
@ -298,7 +298,8 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb)
|
|||
}
|
||||
else if (!(dsb->ds3db_ds3db.vVelocity.x == dsb->device->ds3dl.vVelocity.x &&
|
||||
dsb->ds3db_ds3db.vVelocity.y == dsb->device->ds3dl.vVelocity.y &&
|
||||
dsb->ds3db_ds3db.vVelocity.z == dsb->device->ds3dl.vVelocity.z))
|
||||
dsb->ds3db_ds3db.vVelocity.z == dsb->device->ds3dl.vVelocity.z) &&
|
||||
!(vDistance.x == 0.0f && vDistance.y == 0.0f && vDistance.z == 0.0f))
|
||||
{
|
||||
/* calculate length of ds3db_ds3db.vVelocity component which causes Doppler Effect
|
||||
NOTE: if buffer moves TOWARDS the listener, its velocity component is NEGATIVE
|
||||
|
|
|
@ -1439,6 +1439,8 @@ static void test_doppler(GUID *guid, BOOL play)
|
|||
check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, -90, 22050, 29400);
|
||||
check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, 90, 22050, 17640);
|
||||
|
||||
check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 0, -90, 22050, 22050);
|
||||
|
||||
IDirectSound3DListener_Release(listener);
|
||||
ref = IDirectSoundBuffer_Release(primary);
|
||||
ok(!ref, "Got outstanding refcount %ld.\n", ref);
|
||||
|
|
Loading…
Reference in a new issue