fix for m-audio ASIO driver

This commit is contained in:
Volker Fischer 2010-03-02 18:22:55 +00:00
parent 3b4eb7f605
commit e1b949e318
2 changed files with 64 additions and 40 deletions

View File

@ -7,6 +7,8 @@
- improvement of network buffer (jitter buffer) in case of small buffer sizes
- bug fix for M-Audio Delta ASIO driver
3.0.3

View File

@ -337,7 +337,18 @@ int CSound::GetActualBufferSize ( const int iDesiredBufferSizeMono )
}
else
{
// General case ------------------------------------------------
if ( HWBufferInfo.lGranularity <= 0 )
{
// Special case (seen for EMU audio cards): granularity is
// zero or less than zero.
// There is no definition of this case in the ASIO SDK
// document. We assume here that all buffer sizes in between
// minimum and maximum buffer sizes are allowed.
iActualBufferSizeMono = iDesiredBufferSizeMono;
}
else
{
// General case --------------------------------------------
// initialization
int iTrialBufSize = HWBufferInfo.lMinSize;
int iLastTrialBufSize = HWBufferInfo.lMinSize;
@ -365,7 +376,8 @@ int CSound::GetActualBufferSize ( const int iDesiredBufferSizeMono )
// store old trial buffer size
iLastTrialBufSize = iTrialBufSize;
// increment trial buffer size (check for special case first)
// increment trial buffer size (check for special
// case first)
if ( HWBufferInfo.lGranularity == -1 )
{
// special case: buffer sizes are a power of 2
@ -378,11 +390,21 @@ int CSound::GetActualBufferSize ( const int iDesiredBufferSizeMono )
}
}
// clip trial buffer size (it may happen in the while
// routine that "iTrialBufSize" is larger than "lMaxSize" in
// case "lMaxSize - lMinSize" is not divisible by the
// granularity)
if ( iTrialBufSize > HWBufferInfo.lMaxSize )
{
iTrialBufSize = HWBufferInfo.lMaxSize;
}
// set ASIO buffer size
iActualBufferSizeMono = iTrialBufSize;
}
}
}
}
return iActualBufferSizeMono;
}