From 7ed9afd0d94ce6b2d92570d7c9495f0ee3c4ba6f Mon Sep 17 00:00:00 2001 From: CrSjimo Date: Sat, 19 Oct 2024 01:48:27 +0800 Subject: [PATCH] fix bugs --- src/core/source/FutureAudioSource.cpp | 3 ++- src/core/source/FutureAudioSourceClipSeries.cpp | 1 + src/format/source/AudioFormatInputSource.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/source/FutureAudioSource.cpp b/src/core/source/FutureAudioSource.cpp index f59b5a4..d551252 100644 --- a/src/core/source/FutureAudioSource.cpp +++ b/src/core/source/FutureAudioSource.cpp @@ -203,7 +203,8 @@ namespace talcs { case Cancelled: break; case Ready: - source()->close(); + if (d->src) + d->src->close(); break; } talcs::AudioSource::close(); diff --git a/src/core/source/FutureAudioSourceClipSeries.cpp b/src/core/source/FutureAudioSourceClipSeries.cpp index 3cc6389..396628e 100644 --- a/src/core/source/FutureAudioSourceClipSeries.cpp +++ b/src/core/source/FutureAudioSourceClipSeries.cpp @@ -173,6 +173,7 @@ namespace talcs { Q_D(FutureAudioSourceClipSeries); QMutexLocker locker(&d->mutex); d->closeAllClips(); + d->notifyResume(); AudioSource::close(); } diff --git a/src/format/source/AudioFormatInputSource.cpp b/src/format/source/AudioFormatInputSource.cpp index 3225766..d133ad8 100644 --- a/src/format/source/AudioFormatInputSource.cpp +++ b/src/format/source/AudioFormatInputSource.cpp @@ -83,7 +83,7 @@ namespace talcs { QMutexLocker locker(&d->mutex); Q_ASSERT(d->io && isOpen()); auto readLength = qMax(qint64(0), qMin(readData.length, length() - d->position)); - d->resampler->process(readData); + d->resampler->process({readData.buffer, readData.startPos, readLength, readData.silentFlags}); if (d->doStereoize && d->io->channelCount() == 1 && readData.buffer->channelCount() > 1) { readData.buffer->setSampleRange(1, readData.startPos, readLength, *readData.buffer, 0, readData.startPos); }