From 8b5cf557dfe5acefb9eb0751c1b83258faf5dd36 Mon Sep 17 00:00:00 2001 From: jeffqjiangNew <142832361+jeffqjiangNew@users.noreply.github.com> Date: Mon, 7 Apr 2025 20:34:01 -0400 Subject: [PATCH] * AVC: Fixed an issue in video size change cases, where the remaining decoded buffers of the previous video size in DPB are not output. (#550) - We need to flush DPB before decoder reconfiguration. Co-authored-by: Kiriti Gowda [ROCm/rocdecode commit: 9127f2ccba20bb2c331cca70b4685c5e99d3f1c3] --- projects/rocdecode/src/parser/avc_parser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/rocdecode/src/parser/avc_parser.cpp b/projects/rocdecode/src/parser/avc_parser.cpp index d3c95fb72d..5192eec05b 100644 --- a/projects/rocdecode/src/parser/avc_parser.cpp +++ b/projects/rocdecode/src/parser/avc_parser.cpp @@ -71,6 +71,9 @@ rocDecStatus AvcVideoParser::ParseVideoData(RocdecSourceDataPacket *p_data) { // Init Roc decoder for the first time or reconfigure the existing decoder if (new_seq_activated_) { + if (FlushDpb() != PARSER_OK) { + return ROCDEC_RUNTIME_ERROR; + } if (NotifyNewSps(&sps_list_[active_sps_id_]) != PARSER_OK) { return ROCDEC_RUNTIME_ERROR; } @@ -2762,7 +2765,7 @@ ParserResult AvcVideoParser::MarkDecodedRefPics() { } // Output the remaining picutres in DPB if (FlushDpb() != PARSER_OK) { - return PARSER_FAIL; + return PARSER_FAIL; } dpb_buffer_.num_long_term = 0; dpb_buffer_.num_short_term = 0;