The workaround is basically seeking into the track (see code below).
With 2.4.17 we have error also on BASS_ChannelSetPosition(handle, BASS_POS_BYTE);
BASS_ChannelSetPosition(handle, 0, BASS_POS_BYTE); return false with value of BASS_ErrorGetCode BASS_ERROR_POSITION.
This is working fine with older versions of BASS.
long long getLength(long long handle)
{
long long length = BASS_ChannelGetLength(handle, BASS_POS_BYTE);
long long position = BASS_ChannelGetPosition(handle, BASS_POS_BYTE);
if (length == (long long)(-1) && position != (long long)(-1) && BASS_ChannelSetPosition(handle, 0, BASS_POS_BYTE))
{
long long step = 1 << 20;
long long pos = 0;
while (TRUE)
{
if (BASS_ChannelSetPosition(handle, pos + step, BASS_POS_BYTE))
pos += step;
else if (step != 1)
step /= 2;
else
{
length = pos;
break;
}
}
BASS_ChannelSetPosition(handle, position, BASS_POS_BYTE);
}
return length;
}