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 14440425FD for ; Thu, 23 Jun 2022 14:14:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 60ABF68B67B; Thu, 23 Jun 2022 17:14:21 +0300 (EEST) Received: from btbn.de (btbn.de [136.243.74.85]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0AEB8680446 for ; Thu, 23 Jun 2022 17:14:15 +0300 (EEST) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id 4283F26F450 for ; Thu, 23 Jun 2022 16:14:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1655993654; bh=ox80eFXKQSokd6Dy6iIDNlxiSOg6DyiU99e51k8185I=; h=Date:Subject:To:References:From:In-Reply-To; b=cYmTivdmDKPL19Zu3xP1Nv67Q7Nf7sVDovrMeJC92bE99Cx1kCDuK/cUAMd7djQAZ UTpQi2ByGoaq7yi9NZOSeX9d/BvZKHIdOqNxT5qzLGdUpbiyUicaVIoy5ZQbDR0+ed jM39CpQKvuTKKSyyFuTOGwJtTTswIWh/aRC6WysXa0ud/43AGK7fZ59NB67LazOZsi a85UVxBmIFMj78MJkfC9cymZDFh9Pz3pbP+GKLN7AikCpRmtNv8OEZqdKWdYS48NOk l1C7vIrNBe9ZkXhEI6PDyd5Mlm6FZO+5JpTXRDiou9nuX6CevgceIJZGY1G9fr7TKO /HpfzyAJeiDrw== Message-ID: <21dd7f49-3c98-0743-0730-f63e9eec7419@rothenpieler.org> Date: Thu, 23 Jun 2022 16:14:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: From: Timo Rothenpieler In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] avcodec/cuviddec: fix AV1 decoding error 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 23/06/2022 11:10, Zhao Zhili wrote: > From: Zhao Zhili > > Regression from 45e3b6a68. cuvidParseVideoData report unknown > error with AV1CodecConfigurationRecord. > --- > libavcodec/cuviddec.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c > index cb3cda7e24..584fff40ed 100644 > --- a/libavcodec/cuviddec.c > +++ b/libavcodec/cuviddec.c > @@ -953,6 +953,17 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx) > extradata_size = avctx->extradata_size; > } > > +#if CONFIG_AV1_CUVID_DECODER && defined(CUVID_HAS_AV1_SUPPORT) > + if (avctx->codec->id == AV_CODEC_ID_AV1 && > + extradata_size > 4 && > + extradata && extradata[0] & 0x80) { > + // skip AV1CodecConfigurationRecord to keep configOBUs only, > + // otherwise cuvidParseVideoData report unknown error. > + extradata += 4; > + extradata_size -= 4; > + } > +#endif Checking the defines shouldn't be necessary. The codec ID should never be AV1 if it's not enabled, and the code does not contain anything AV1 specific. > ctx->cuparse_ext = av_mallocz(sizeof(*ctx->cuparse_ext) > + FFMAX(extradata_size - (int)sizeof(ctx->cuparse_ext->raw_seqhdr_data), 0)); > if (!ctx->cuparse_ext) { I'm not quite sure I understand what causes this. Something about the mp4 demuxer changed, yes. But what about other containers? Why wasn't this an issue before? The code that was removed in 45e3b6a68 seems to just have always skipped the first 4 byte unconditionally. A little more info in the commit message would be nice here. Specially a sentence or two about the "& 80" part. Code LGTM otherwise. _______________________________________________ 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".