Please post your WASAPIPROC function to have a look at. I suspect it may look something like this?
DWORD CALLBACK WASAPIPROC(void *buffer, DWORD length, void *user)
{
return BASS_ChannelGetData(decoder, buffer, length);
}
Note that BASS_ChannelGetData will return -1 when it reaches the end of the file, so you would need to check for that...
DWORD CALLBACK WASAPIPROC(void *buffer, DWORD length, void *user)
{
int r=BASS_ChannelGetData(decoder, buffer, length);
if (r==-1) return 0; // error = no data
return r;
}