From 7717749b72cb30c1a03eb60f974eba93a7d742a6 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 15 Oct 2022 14:34:42 -0500 Subject: [PATCH] Reduce max queued frames to avoid exhausting the decoder buffer pool --- app/streaming/video/ffmpeg-renderers/pacer/pacer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/pacer/pacer.cpp b/app/streaming/video/ffmpeg-renderers/pacer/pacer.cpp index 721d8293..ece43257 100644 --- a/app/streaming/video/ffmpeg-renderers/pacer/pacer.cpp +++ b/app/streaming/video/ffmpeg-renderers/pacer/pacer.cpp @@ -11,8 +11,11 @@ #endif // Limit the number of queued frames to prevent excessive memory consumption -// if the V-Sync source or renderer is blocked for a while. -#define MAX_QUEUED_FRAMES 8 +// if the V-Sync source or renderer is blocked for a while. It's important +// that the sum of all queued frames between both pacing and rendering queues +// must not exceed the number buffer pool size to avoid running the decoder +// out of available decoding surfaces. +#define MAX_QUEUED_FRAMES 4 // We may be woken up slightly late so don't go all the way // up to the next V-sync since we may accidentally step into