From 77386f8dfcc7cf7861ac950435bd61714d3494b5 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 8 Feb 2020 17:56:30 -0800 Subject: [PATCH] Reduce buffering for MMAL to avoid requiring 128 MB VRAM split --- app/streaming/video/ffmpeg-renderers/mmal.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/mmal.cpp b/app/streaming/video/ffmpeg-renderers/mmal.cpp index 3418b10d..1c6099a0 100644 --- a/app/streaming/video/ffmpeg-renderers/mmal.cpp +++ b/app/streaming/video/ffmpeg-renderers/mmal.cpp @@ -22,9 +22,11 @@ MmalRenderer::~MmalRenderer() } } -bool MmalRenderer::prepareDecoderContext(AVCodecContext*, AVDictionary**) +bool MmalRenderer::prepareDecoderContext(AVCodecContext*, AVDictionary** options) { - /* Nothing to do */ + // FFmpeg defaults this to 10 which is too large to fit in the default 64 MB VRAM split. + // Reducing to 2 seems to work fine for our bitstreams (max of 1 buffered frame needed). + av_dict_set_int(options, "extra_buffers", 2, 0); SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Using MMAL renderer");