diff --git a/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp b/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp index 44b3019a3..ba1b8f471 100644 --- a/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp +++ b/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp @@ -251,6 +251,10 @@ void FfmpegDecoder::Reset() { av_audio_fifo_free(this->outputFifo); this->outputFifo = nullptr; } + if (this->resampler) { + swr_free(&this->resampler); + this->resampler = nullptr; + } this->streamId = -1; } @@ -479,9 +483,6 @@ bool FfmpegDecoder::DrainResamplerToFifoQueue() { } } - swr_free(&this->resampler); - this->resampler = nullptr; - return true; }