The way to do perfect gapless playback is to use the same output stream to play all the tracks, ie. feed decoding channels into a custom stream. For simplicity, I'd suggest using
BASSmix to do it, something like this...
mixer=BASS_Mixer_StreamCreate(44100, 2, BASS_MIXER_END); // create mixer
BASS_ChannelSetSync(mixer, BASS_SYNC_END|BASS_SYNC_MIXTIME, 0, EndSync, 0); // set sync for end
source=BASS_StreamCreateFile(...,BASS_STREAM_DECODE|BASS_SAMPLE_FLOAT); // open 1st source
BASS_Mixer_StreamAddChannel(mixer, source, BASS_STREAM_AUTOFREE); // plug it in (and auto-free it when it ends)
BASS_ChannelPlay(mixer, FALSE); // start playing
...
void CALLBACK EndSync(HSYNC handle, DWORD channel, DWORD data, DWORD user)
{
if (!more_sources) return;
source=BASS_StreamCreateFile(...,BASS_STREAM_DECODE|BASS_SAMPLE_FLOAT); // open next source
BASS_Mixer_StreamAddChannel(mixer, source, BASS_STREAM_AUTOFREE|BASS_MIXER_NORAMPIN); // plug it in
BASS_ChannelSetPosition(mixer, 0); // reset the mixer
}