Update the audio offset when skipping a full update

This commit is contained in:
Chris Robinson 2022-09-28 03:40:10 -07:00 committed by Christoph Oelckers
parent 1a233b08c3
commit a2f0c1aee6

View file

@ -281,14 +281,15 @@ public:
if(!ZMusic_FillStream(MusicStream, buff, len))
return false;
// Offset the measured audio position to account for the skipped samples.
audiooffset += skip/framesize;
if(skip == len)
return ZMusic_FillStream(MusicStream, buff, len);
memmove(buff, (char*)buff+skip, len-skip);
if(!ZMusic_FillStream(MusicStream, (char*)buff+len-skip, skip))
memset((char*)buff+len-skip, 0, skip);
// Offset the measured audio position to account for the skipped samples.
audiooffset += skip/framesize;
return true;
}