Commit b923aea7 authored by Anton Baskanov's avatar Anton Baskanov Committed by Alexandre Julliard

dsound: Clamp the shifted frequency to [DSBFREQUENCY_MIN, DSBFREQUENCY_MAX].

parent 3d5f2f87
......@@ -312,7 +312,7 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb)
flFreq = dsb->ds3db_freq * (DEFAULT_VELOCITY/(DEFAULT_VELOCITY + flLimitedVel));
TRACE("doppler: Relative velocity (component) = %f => Doppler shift: %ld Hz -> %f Hz\n",
flRelativeVel, dsb->ds3db_freq, flFreq);
dsb->freq = flFreq;
dsb->freq = max(DSBFREQUENCY_MIN, min(DSBFREQUENCY_MAX, (DWORD)flFreq));
}
DSOUND_RecalcFormat(dsb);
......
......@@ -1450,7 +1450,6 @@ static void test_doppler(GUID *guid, BOOL play)
check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, 240, 22050, 14700);
/* The shifted frequency is limited to DSBFREQUENCY_MAX. */
/* Wine TODO: The frequency is not limited. */
check_doppler(dsound, listener, play, DS3DMODE_NORMAL, 0, 0, 1, -90, 176400, 200000);
IDirectSound3DListener_Release(listener);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment