From: Anton Baskanov baskanov@gmail.com
--- dlls/dsound/tests/ds3d.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/dsound/tests/ds3d.c b/dlls/dsound/tests/ds3d.c index 9c149dbcd9b..9ad8e3e58fc 100644 --- a/dlls/dsound/tests/ds3d.c +++ b/dlls/dsound/tests/ds3d.c @@ -1452,6 +1452,9 @@ static void test_doppler(GUID *guid, BOOL play) /* The shifted frequency is limited to DSBFREQUENCY_MAX. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, -90, 176400, 200000);
+ /* Wine TODO: The frequency is too low. */ + check_doppler(dsound, listener, play, DS3DMODE_HEADRELATIVE, 0, -90, 1, -90, 22050, 29400); + IDirectSound3DListener_Release(listener); ref = IDirectSoundBuffer_Release(primary); ok(!ref, "Got outstanding refcount %ld.\n", ref);
From: Anton Baskanov baskanov@gmail.com
--- dlls/dsound/sound3d.c | 7 +++---- dlls/dsound/tests/ds3d.c | 1 - 2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/dsound/sound3d.c b/dlls/dsound/sound3d.c index c22a3d5509f..0008e34755d 100644 --- a/dlls/dsound/sound3d.c +++ b/dlls/dsound/sound3d.c @@ -182,12 +182,14 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) /* we need to calculate distance between buffer and listener*/ vDistance = VectorBetweenTwoPoints(&dsb->device->ds3dl.vPosition, &dsb->ds3db_ds3db.vPosition); flDistance = VectorMagnitude (&vDistance); + vRelativeVel = VectorBetweenTwoPoints(&dsb->device->ds3dl.vVelocity, &dsb->ds3db_ds3db.vVelocity); break; case DS3DMODE_HEADRELATIVE: TRACE("Head-relative 3D processing mode\n"); /* distance between buffer and listener is same as buffer's position */ vDistance = dsb->ds3db_ds3db.vPosition; flDistance = VectorMagnitude (&vDistance); + vRelativeVel = dsb->ds3db_ds3db.vVelocity; break; default: TRACE("3D processing disabled\n"); @@ -293,14 +295,11 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) dsb->freq = dsb->ds3db_freq;
/* doppler shift*/ - vRelativeVel = VectorBetweenTwoPoints(&dsb->device->ds3dl.vVelocity, &dsb->ds3db_ds3db.vVelocity); if (!VectorMagnitude(&dsb->ds3db_ds3db.vVelocity) && !VectorMagnitude(&dsb->device->ds3dl.vVelocity)) { TRACE("doppler: Buffer and Listener don't have velocities\n"); } - 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) && + else if (!(vRelativeVel.x == 0.0f && vRelativeVel.y == 0.0f && vRelativeVel.z == 0.0f) && !(vDistance.x == 0.0f && vDistance.y == 0.0f && vDistance.z == 0.0f)) { /* calculate length of vRelativeVel component which causes Doppler Effect diff --git a/dlls/dsound/tests/ds3d.c b/dlls/dsound/tests/ds3d.c index 9ad8e3e58fc..9f5752a203c 100644 --- a/dlls/dsound/tests/ds3d.c +++ b/dlls/dsound/tests/ds3d.c @@ -1452,7 +1452,6 @@ static void test_doppler(GUID *guid, BOOL play) /* The shifted frequency is limited to DSBFREQUENCY_MAX. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, -90, 176400, 200000);
- /* Wine TODO: The frequency is too low. */ check_doppler(dsound, listener, play, DS3DMODE_HEADRELATIVE, 0, -90, 1, -90, 22050, 29400);
IDirectSound3DListener_Release(listener);
From: Anton Baskanov baskanov@gmail.com
--- dlls/dsound/tests/ds3d.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/dsound/tests/ds3d.c b/dlls/dsound/tests/ds3d.c index 9f5752a203c..781d23e876f 100644 --- a/dlls/dsound/tests/ds3d.c +++ b/dlls/dsound/tests/ds3d.c @@ -1454,6 +1454,9 @@ static void test_doppler(GUID *guid, BOOL play)
check_doppler(dsound, listener, play, DS3DMODE_HEADRELATIVE, 0, -90, 1, -90, 22050, 29400);
+ /* Wine TODO: The frequency is not updated. */ + check_doppler(dsound, listener, play, DS3DMODE_DISABLE, 0, 0, 1, -90, 22050, 22050); + IDirectSound3DListener_Release(listener); ref = IDirectSoundBuffer_Release(primary); ok(!ref, "Got outstanding refcount %ld.\n", ref);
From: Anton Baskanov baskanov@gmail.com
--- dlls/dsound/sound3d.c | 2 ++ dlls/dsound/tests/ds3d.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/dsound/sound3d.c b/dlls/dsound/sound3d.c index 0008e34755d..7ad37a30f8d 100644 --- a/dlls/dsound/sound3d.c +++ b/dlls/dsound/sound3d.c @@ -196,6 +196,8 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) /* this one is here only to eliminate annoying warning message */ dsb->volpan.lVolume = dsb->ds3db_lVolume; DSOUND_RecalcVolPan (&dsb->volpan); + dsb->freq = dsb->ds3db_freq; + DSOUND_RecalcFormat(dsb); return; } diff --git a/dlls/dsound/tests/ds3d.c b/dlls/dsound/tests/ds3d.c index 781d23e876f..a8da83df6e1 100644 --- a/dlls/dsound/tests/ds3d.c +++ b/dlls/dsound/tests/ds3d.c @@ -1454,7 +1454,6 @@ static void test_doppler(GUID *guid, BOOL play)
check_doppler(dsound, listener, play, DS3DMODE_HEADRELATIVE, 0, -90, 1, -90, 22050, 29400);
- /* Wine TODO: The frequency is not updated. */ check_doppler(dsound, listener, play, DS3DMODE_DISABLE, 0, 0, 1, -90, 22050, 22050);
IDirectSound3DListener_Release(listener);
From: Anton Baskanov baskanov@gmail.com
--- dlls/dsound/tests/ds3d.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
diff --git a/dlls/dsound/tests/ds3d.c b/dlls/dsound/tests/ds3d.c index a8da83df6e1..14f83d9c0a0 100644 --- a/dlls/dsound/tests/ds3d.c +++ b/dlls/dsound/tests/ds3d.c @@ -1456,6 +1456,44 @@ static void test_doppler(GUID *guid, BOOL play)
check_doppler(dsound, listener, play, DS3DMODE_DISABLE, 0, 0, 1, -90, 22050, 22050);
+ hr = IDirectSound3DListener_SetDistanceFactor(listener, 10, DS3D_DEFERRED); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + /* Wine TODO: The distance factor has no effect. */ + check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 0.1f, -9, 22050, 29400); + /* Wine TODO: The distance factor has no effect. */ + check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 0.1f, 9, 22050, 17640); + /* Wine TODO: The distance factor has no effect. */ + check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 9, 0.1f, 0, 22050, 29400); + /* Wine TODO: The distance factor has no effect. */ + check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, -9, 0.1f, 0, 22050, 17640); + /* Wine TODO: The distance factor has no effect. */ + check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 0.1f, -24, 22050, 44100); + /* Wine TODO: The distance factor has no effect. */ + check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 0.1f, 24, 22050, 14700); + + hr = IDirectSound3DListener_SetDistanceFactor(listener, DS3D_DEFAULTDISTANCEFACTOR, DS3D_DEFERRED); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IDirectSound3DListener_SetDopplerFactor(listener, 2, DS3D_DEFERRED); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + /* Wine TODO: The Doppler factor has no effect. */ + check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, -45, 22050, 29400); + /* Wine TODO: The Doppler factor has no effect. */ + check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, 45, 22050, 17640); + /* Wine TODO: The Doppler factor has no effect. */ + check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 45, 1, 0, 22050, 29400); + /* Wine TODO: The Doppler factor has no effect. */ + check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, -45, 1, 0, 22050, 17640); + /* Wine TODO: The Doppler factor has no effect. */ + check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, -120, 22050, 44100); + /* Wine TODO: The Doppler factor has no effect. */ + check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, 120, 22050, 14700); + + hr = IDirectSound3DListener_SetDopplerFactor(listener, DS3D_DEFAULTDOPPLERFACTOR, DS3D_DEFERRED); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + IDirectSound3DListener_Release(listener); ref = IDirectSoundBuffer_Release(primary); ok(!ref, "Got outstanding refcount %ld.\n", ref);
From: Anton Baskanov baskanov@gmail.com
--- dlls/dsound/sound3d.c | 5 +++-- dlls/dsound/tests/ds3d.c | 12 ------------ 2 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/dlls/dsound/sound3d.c b/dlls/dsound/sound3d.c index 7ad37a30f8d..3fa9ff6801f 100644 --- a/dlls/dsound/sound3d.c +++ b/dlls/dsound/sound3d.c @@ -168,7 +168,7 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) float a, ingain; /* doppler shift related stuff */ D3DVECTOR vRelativeVel; - D3DVALUE flFreq, flRelativeVel, flLimitedVel; + D3DVALUE flFreq, flRelativeVel, flLimitedVel, flVelocityFactor;
TRACE("(%p)\n",dsb);
@@ -308,7 +308,8 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb) NOTE: if buffer moves TOWARDS the listener, its velocity component is NEGATIVE if buffer moves AWAY from listener, its velocity component is POSITIVE */ flRelativeVel = ProjectVector(&vRelativeVel, &vDistance); - flLimitedVel = max(-DEFAULT_VELOCITY/2, min(DEFAULT_VELOCITY/2, flRelativeVel)); + flVelocityFactor = dsb->device->ds3dl.flDistanceFactor * dsb->device->ds3dl.flDopplerFactor; + flLimitedVel = max(-DEFAULT_VELOCITY/2, min(DEFAULT_VELOCITY/2, flRelativeVel * flVelocityFactor)); /* formula taken from Gianicoli D.: Physics, 4th edition: */ flFreq = dsb->ds3db_freq * (DEFAULT_VELOCITY/(DEFAULT_VELOCITY + flLimitedVel)); TRACE("doppler: Relative velocity (component) = %f => Doppler shift: %ld Hz -> %f Hz\n", diff --git a/dlls/dsound/tests/ds3d.c b/dlls/dsound/tests/ds3d.c index 14f83d9c0a0..9c65f674b3b 100644 --- a/dlls/dsound/tests/ds3d.c +++ b/dlls/dsound/tests/ds3d.c @@ -1459,17 +1459,11 @@ static void test_doppler(GUID *guid, BOOL play) hr = IDirectSound3DListener_SetDistanceFactor(listener, 10, DS3D_DEFERRED); ok(hr == S_OK, "Got hr %#lx.\n", hr);
- /* Wine TODO: The distance factor has no effect. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 0.1f, -9, 22050, 29400); - /* Wine TODO: The distance factor has no effect. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 0.1f, 9, 22050, 17640); - /* Wine TODO: The distance factor has no effect. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 9, 0.1f, 0, 22050, 29400); - /* Wine TODO: The distance factor has no effect. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, -9, 0.1f, 0, 22050, 17640); - /* Wine TODO: The distance factor has no effect. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 0.1f, -24, 22050, 44100); - /* Wine TODO: The distance factor has no effect. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 0.1f, 24, 22050, 14700);
hr = IDirectSound3DListener_SetDistanceFactor(listener, DS3D_DEFAULTDISTANCEFACTOR, DS3D_DEFERRED); @@ -1478,17 +1472,11 @@ static void test_doppler(GUID *guid, BOOL play) hr = IDirectSound3DListener_SetDopplerFactor(listener, 2, DS3D_DEFERRED); ok(hr == S_OK, "Got hr %#lx.\n", hr);
- /* Wine TODO: The Doppler factor has no effect. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, -45, 22050, 29400); - /* Wine TODO: The Doppler factor has no effect. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, 45, 22050, 17640); - /* Wine TODO: The Doppler factor has no effect. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 45, 1, 0, 22050, 29400); - /* Wine TODO: The Doppler factor has no effect. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, -45, 1, 0, 22050, 17640); - /* Wine TODO: The Doppler factor has no effect. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, -120, 22050, 44100); - /* Wine TODO: The Doppler factor has no effect. */ check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, 120, 22050, 14700);
hr = IDirectSound3DListener_SetDopplerFactor(listener, DS3D_DEFAULTDOPPLERFACTOR, DS3D_DEFERRED);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=133053
Your paranoid android.
=== debian11 (32 bit report) ===
wmvcore: wmvcore.c:1713: Test failed: Stream 0: Format 4: Got hr 0xc00d0041. wmvcore.c:1730: Test failed: Stream 0: Format 4: Media types didn't match.