Skip to content

Commit

Permalink
fix bug in BufferingAudioSource
Browse files Browse the repository at this point in the history
  • Loading branch information
CrSjimo committed Feb 6, 2024
1 parent 8e3d23e commit d75ea89
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/source/BufferingAudioSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,10 @@ namespace talcs {
for (qint64 offset = 0; offset < length; offset += frameLength) {
if (d->isTerminateRequested)
return;
d->src->read(AudioSourceReadData(&d->buf, startPos + offset, qMin(frameLength, length - offset)));
d->tailPosition += qMin(frameLength, length - offset);
if (frameLength > length - offset)
break;
d->src->read(AudioSourceReadData(&d->buf, startPos + offset, frameLength));
d->tailPosition += frameLength;
}
}

Expand Down

0 comments on commit d75ea89

Please sign in to comment.