Fix decoder so it ends properly on non-looped files when Repeat One is enabled.

CQTexperiment
Christopher Snowhill 2018-07-17 18:09:59 -07:00
parent 6f59d10162
commit 5c25e3b071
1 changed files with 3 additions and 1 deletions

View File

@ -61,7 +61,9 @@
{
BOOL repeatone = IsRepeatOneSet();
if (!repeatone) {
BOOL loopokay = repeatone && stream->loop_flag;
if (!loopokay) {
if (framesRead >= totalFrames) return 0;
else if (framesRead + frames > totalFrames)
frames = (UInt32)(totalFrames - framesRead);