mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-26 09:08:44 +02:00
Use the cached rates array if they contain the passed rate.
This commit is contained in:
parent
efabeb4a79
commit
b6c5d9296d
@ -1922,7 +1922,7 @@ wxArrayLong AudioIO::GetSupportedPlaybackRates(int devIndex, double rate)
|
|||||||
|
|
||||||
// Check if we can use the cached rates
|
// Check if we can use the cached rates
|
||||||
if (mCachedPlaybackIndex != -1 && devIndex == mCachedPlaybackIndex
|
if (mCachedPlaybackIndex != -1 && devIndex == mCachedPlaybackIndex
|
||||||
&& rate == 0.0)
|
&& (rate == 0.0 || mCachedPlaybackRates.Index(rate) != wxNOT_FOUND))
|
||||||
{
|
{
|
||||||
return mCachedPlaybackRates;
|
return mCachedPlaybackRates;
|
||||||
}
|
}
|
||||||
@ -1983,7 +1983,7 @@ wxArrayLong AudioIO::GetSupportedCaptureRates(int devIndex, double rate)
|
|||||||
|
|
||||||
// Check if we can use the cached rates
|
// Check if we can use the cached rates
|
||||||
if (mCachedCaptureIndex != -1 && devIndex == mCachedCaptureIndex
|
if (mCachedCaptureIndex != -1 && devIndex == mCachedCaptureIndex
|
||||||
&& rate == 0.0)
|
&& (rate == 0.0 || mCachedCaptureRates.Index(rate) != wxNOT_FOUND))
|
||||||
{
|
{
|
||||||
return mCachedCaptureRates;
|
return mCachedCaptureRates;
|
||||||
}
|
}
|
||||||
@ -2054,7 +2054,7 @@ wxArrayLong AudioIO::GetSupportedSampleRates(int playDevice, int recDevice, doub
|
|||||||
if (mCachedPlaybackIndex != -1 && mCachedCaptureIndex != -1 &&
|
if (mCachedPlaybackIndex != -1 && mCachedCaptureIndex != -1 &&
|
||||||
playDevice == mCachedPlaybackIndex &&
|
playDevice == mCachedPlaybackIndex &&
|
||||||
recDevice == mCachedCaptureIndex &&
|
recDevice == mCachedCaptureIndex &&
|
||||||
rate == 0.0)
|
(rate == 0.0 || mCachedSampleRates.Index(rate) != wxNOT_FOUND))
|
||||||
{
|
{
|
||||||
return mCachedSampleRates;
|
return mCachedSampleRates;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user