From 966f338d96559bd29ff350fa1282e1c82da0995f Mon Sep 17 00:00:00 2001 From: Rajy Rawther Date: Fri, 8 Aug 2025 07:11:10 -0700 Subject: [PATCH] set min: number of decoded surfaces to non-zero value for ffmpeg based decoding (#627) [ROCm/rocdecode commit: d9690d1715b685b5c29569e9195842ea15d6ba85] --- .../src/rocdecode-host/avcodec/avcodec_videodecoder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/rocdecode/src/rocdecode-host/avcodec/avcodec_videodecoder.cpp b/projects/rocdecode/src/rocdecode-host/avcodec/avcodec_videodecoder.cpp index 9dfe161f21..2f08ce748e 100644 --- a/projects/rocdecode/src/rocdecode-host/avcodec/avcodec_videodecoder.cpp +++ b/projects/rocdecode/src/rocdecode-host/avcodec/avcodec_videodecoder.cpp @@ -388,7 +388,8 @@ rocDecStatus AvcodecVideoDecoder::NotifyNewSequence(AVFrame *p_frame) { p_video_format->bit_depth_luma_minus8 = BitDepthFromPixelFormat(dec_context_->pix_fmt) - 8; p_video_format->bit_depth_chroma_minus8 = p_video_format->bit_depth_luma_minus8; p_video_format->progressive_sequence = !p_frame->interlaced_frame; - p_video_format->min_num_decode_surfaces = dec_context_->delay + dec_context_->max_b_frames; + //number of decode surfaces are internal and not exposed in avcodec based decoding. Setting some value for sanity + p_video_format->min_num_decode_surfaces = dec_frames_.size(); p_video_format->coded_width = p_frame->linesize[0]; p_video_format->coded_height = p_frame->height; p_video_format->chroma_format = AVPixelFormat2rocDecVideoChromaFormat(dec_context_->pix_fmt);