bug fix in case max and min values for supported ASIO driver frame sizes are the same (software freezes in this case)

This commit is contained in:
Volker Fischer 2009-08-16 00:26:48 +00:00
parent 1fac1056ea
commit c549ae90f0

View file

@ -263,6 +263,16 @@ int CSound::GetActualBufferSize ( const int iDesiredBufferSizeMono )
}
else
{
// ASIO SDK 2.2: "Notes: When minimum and maximum buffer size are
// equal, the preferred buffer size has to be the same value as
// well; granularity should be 0 in this case."
if ( HWBufferInfo.lMinSize == HWBufferInfo.lMaxSize )
{
iActualBufferSizeMono = HWBufferInfo.lMinSize;
}
else
{
// General case ------------------------------------------------
// initialization
int iTrialBufSize = HWBufferInfo.lMinSize;
int iLastTrialBufSize = HWBufferInfo.lMinSize;
@ -307,6 +317,7 @@ int CSound::GetActualBufferSize ( const int iDesiredBufferSizeMono )
iActualBufferSizeMono = iTrialBufSize;
}
}
}
return iActualBufferSizeMono;
}