From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id D084E4AAE8 for ; Wed, 12 Jun 2024 08:15:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C66AC68D891; Wed, 12 Jun 2024 11:15:18 +0300 (EEST) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8E9BE68D7BB for ; Wed, 12 Jun 2024 11:15:12 +0300 (EEST) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=F2Hi3rrc; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 8B94D4DA7 for ; Wed, 12 Jun 2024 10:15:10 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Q8zgDVsXCxNw for ; Wed, 12 Jun 2024 10:15:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1718180109; bh=J7BP56/Qn6Isw9J0W8gmF7BuwG6xe7fNFLkev5wWZME=; h=From:To:Subject:Date:From; b=F2Hi3rrcMnHuC+VkwNOYs/4hcVRbMY+9p684cxln51se+5p1W89MEzQpjlEq0a5BJ 5HekNAVR67BoM11E+m9LHnnHZKXbn07dtzcIvWiMocKMgU0R216KgJWv/H9zeAumWH MRUmhkwRwgD46cdLDwOyka/044PMnJCnO3jxY1IOtBWJw52TFaIp46mxsA9Kgd2ipm /eoeeFiq0JSeBDq2n/4aEXizrttNUJPVG2wx7EOkA8NiKEweVdX1jQYS7gZmWAa1hM jkMEEa64CUT9RTzqNUWrWMyH/RmLyrd0L3mBxiYm68oEJDnkG2dASwnHyLqOnsMFzH x2tFHjxX54XPA== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 4703E4D42 for ; Wed, 12 Jun 2024 10:15:09 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 1F9B23A02CA for ; Wed, 12 Jun 2024 10:15:09 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jun 2024 10:14:42 +0200 Message-ID: <20240612081442.24114-1-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] lavc/hevcdec: always call hevc_frame_end() after successfully decoding an AU X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Currently it is only done if the final CTB address is at the end of the frame, however that address is not known with hwaccel decoding. As we only support exactly one AU per packet, and not partial/multiple AUs, we can just as well call hevc_frame_end() unconditionally. Fixes hwaccel decoding after d725c737fe2a19091b481d4d115fd939e0a674b2. Reported-by: llyyr --- libavcodec/hevc/hevcdec.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 88f2bcecad..4b95358b95 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -3192,11 +3192,6 @@ static int decode_slice(HEVCContext *s, const H2645NAL *nal, GetBitContext *gb) ret = decode_slice_data(s, nal, gb); if (ret < 0) return ret; - if (ret >= s->cur_frame->ctb_count) { - ret = hevc_frame_end(s); - if (ret < 0) - return ret; - } return 0; } @@ -3370,8 +3365,13 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) } fail: - if (s->cur_frame && s->avctx->active_thread_type == FF_THREAD_FRAME) - ff_progress_frame_report(&s->cur_frame->tf, INT_MAX); + if (s->cur_frame) { + if (ret >= 0) + ret = hevc_frame_end(s); + + if (s->avctx->active_thread_type == FF_THREAD_FRAME) + ff_progress_frame_report(&s->cur_frame->tf, INT_MAX); + } return ret; } -- 2.43.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".