From 88b4a17fe13ffed42130ec7dabdb45a8f664dc47 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 28 Mar 2026 16:30:28 -0500 Subject: [PATCH] Use AV_CODEC_RECEIVE_FRAME_FLAG_SYNCHRONOUS for decoder probing on FFmpeg 8.1 --- app/streaming/video/ffmpeg.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/streaming/video/ffmpeg.cpp b/app/streaming/video/ffmpeg.cpp index 3c328971..9afcabf2 100644 --- a/app/streaming/video/ffmpeg.cpp +++ b/app/streaming/video/ffmpeg.cpp @@ -685,7 +685,12 @@ bool FFmpegVideoDecoder::completeInitialization(const AVCodec* decoder, enum AVP // A few FFmpeg decoders (h264_mmal) process here using a "pull" model. // Those decoders will fail here if the format is not supported. +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(62, 28, 100) + err = avcodec_receive_frame_flags(m_VideoDecoderCtx, frame, + AV_CODEC_RECEIVE_FRAME_FLAG_SYNCHRONOUS); +#else err = avcodec_receive_frame(m_VideoDecoderCtx, frame); +#endif if (err == AVERROR(EAGAIN)) { // Wait a little while to let the hardware work SDL_Delay(100);