Fixed MPEG music looping glitch.

This commit is contained in:
SpinDizzy 2019-02-05 10:30:50 +00:00
parent bb89bc8e54
commit 383e6ac85c

View file

@ -99,14 +99,18 @@ int m1fread(unsigned char *buf, int size1, int size2, void *f)
// if past the end, do the xfer in 2 pieces // if past the end, do the xfer in 2 pieces
if ((total + offset) > end) if ((total + offset) > end)
{ {
memcpy(buf, fstart + offset, end-offset); int temp = end - offset; // this part could be removed
buf += (end-offset); if (temp > 0) // since music lenght
total -= (end-offset); { //
memcpy(buf, fstart + offset, temp); // always multiple
buf += temp; // of 0x240
total -= temp; // I let this as is in case
} //
offset = 0;
fstart = lstart;
end = lend;
} }
fstart = lstart;
offset = 0;
end = lend;
} }
} }