From 042c857895c16e7b9422dbed7aa78a3f333ae44a Mon Sep 17 00:00:00 2001 From: casey langen Date: Mon, 20 Sep 2021 08:05:16 -0700 Subject: [PATCH] Fix sample back pressure leading to increased memory usage over time in FfmpegDecoder. --- src/plugins/ffmpegdecoder/FfmpegDecoder.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp b/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp index c8bb74ba6..44b3019a3 100644 --- a/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp +++ b/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp @@ -429,6 +429,10 @@ bool FfmpegDecoder::ReadSendAndReceivePacket(AVPacket* packet) { return false; } + /* there may still be pending data in the resampler, go ahead + and write to the fifo right now so it doesn't back up */ + this->DrainResamplerToFifoQueue(); + decodedAtLeastOneFrame = true; } }