libxmp backend: Set starting subsong correctly

This commit is contained in:
Cacodemon345 2024-11-23 15:01:25 +06:00 committed by GitHub
parent 3944bbc756
commit 7062053c04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -153,7 +153,10 @@ bool XMPSong::GetData(void *buffer, size_t len)
bool XMPSong::Start()
{
return xmp_start_player(context, samplerate, 0) >= 0;
int ret = xmp_start_player(context, samplerate, 0);
if (ret >= 0)
xmp_set_position(context, subsong);
return ret >= 0;
}
StreamSource* XMP_OpenSong(MusicIO::FileInterface* reader, int samplerate)