Skip to content

Commit

Permalink
fix bug in AudioFormatInputSource
Browse files Browse the repository at this point in the history
  • Loading branch information
CrSjimo committed Oct 16, 2024
1 parent b296d94 commit 2c43a6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/format/source/AudioFormatInputSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ namespace talcs {
Q_D(AudioFormatInputSource);
QMutexLocker locker(&d->mutex);
Q_ASSERT(d->io && isOpen());
auto readLength = qBound(qint64(0), readData.length, length() - d->position);
auto readLength = qMax(qint64(0), qMin(readData.length, length() - d->position));
d->resampler->process(readData);
if (d->doStereoize && d->io->channelCount() == 1 && readData.buffer->channelCount() > 1) {
readData.buffer->setSampleRange(1, readData.startPos, readLength, *readData.buffer, 0, readData.startPos);
Expand Down

0 comments on commit 2c43a6d

Please sign in to comment.