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 2CBE544417 for ; Fri, 9 Sep 2022 13:55:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 62C2968BB1A; Fri, 9 Sep 2022 16:55:22 +0300 (EEST) Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6112668B9E7 for ; Fri, 9 Sep 2022 16:55:16 +0300 (EEST) Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-1274ec87ad5so4147160fac.0 for ; Fri, 09 Sep 2022 06:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=dfZyHZHBCV6tVCvCMLaC7uicFiic2yZWFjuoAzXZKy8=; b=nDFGpNZfxYBu44FAq8tyy04KR2OdVm1m3uICuIeSd4fTdq7CnrqmOcg3HhDfT1UcmM z7XvXYf0OHZKR0PZiucwufCUiIGQn4RS1f8awH/BEAFehCHCCoqIA8On65PRhIyZjs0x agrh+tP9rwPCfFJCRmy4MUQQPTK3iPtgUCM5jqgI5oKgrnlgPaWyrqzIb7dPvOoPkcFj N3wWf2XsSGlO+XCCuktgfyz/Jqj5mwFdMUDyRHthG4crUUSwq33/4jfwsZk4em6R0xM5 1l7kGIjOXjdyabg/K8zM8bLMdXVp/+YgRoNuGCgc81b7180QROgQAtqmHlxqyCyxHTRN P5WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=dfZyHZHBCV6tVCvCMLaC7uicFiic2yZWFjuoAzXZKy8=; b=l03AonN0qBJTb2Wq/4CZ/ZSDauohkk26bnUdHsL0+KJpuzF1OycbTfY0BHHCZZnzuA GuOgiFyMypz/w7HxUkj4PY75PGZelxRZMQkpHItZaEoN9hSxOT0pTT9qQEOftae+AwQN c8rMI2QfI7YESrHWCcQS2ppTmqKK6SPCQ8gUttYvx1Y9gx9GZrTTqa+Da9y50kSRsTSt 6EYebLyvCQw5qcJEK/3eg1MMZXJQvZiJXxLtBqpK6xEdPXXQSGp4rWExob5R8Rlex8eX mC/jHapJkCMsWCfE1aJlRWD3MkfVcmh2Hek/3yB7+x4EgowgVq3Eaqp1c9cSjP3YwBkr pW9g== X-Gm-Message-State: ACgBeo0j4kfFqdIodeO9X+s67xclQVUKdZKn4y5ZstyfMsMj2YZiGmn6 YsT4nPMgjdcXTD5cC/QRtfvQhfVO3rY= X-Google-Smtp-Source: AA6agR6cTI38ZhOVA87BT3SO2W0V62EUfbJjpAEssfwgAQdxi7Qr8fkjZ5Vo7bPclmsYs4dkt4oJLQ== X-Received: by 2002:a05:6808:2392:b0:345:d23f:926f with SMTP id bp18-20020a056808239200b00345d23f926fmr3677195oib.137.1662731714250; Fri, 09 Sep 2022 06:55:14 -0700 (PDT) Received: from [192.168.0.13] ([191.97.187.183]) by smtp.gmail.com with ESMTPSA id q29-20020a4a301d000000b0041ba884d42csm239979oof.42.2022.09.09.06.55.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Sep 2022 06:55:13 -0700 (PDT) Message-ID: Date: Fri, 9 Sep 2022 10:55:13 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] lavc/hevc_ps: fix process failed when SPS before VPS in hvcC 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 9/9/2022 10:09 AM, 1035567130@qq.com wrote: > From: Wang Yaqiang > > In some videos, SPS will be stored before VPS in hvcC box, > parse SPS does not depend on VPS, so the video is expected to be processed normally. > Added "parsed_vps" parameter to indicate whether VPS have been parsed. > Only VPS have been parsed can be verified during SPS parsing. > > Signed-off-by: Wang Yaqiang > --- > libavcodec/hevc_ps.c | 4 ++-- > libavcodec/hevc_ps.h | 1 + > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c > index f665d8053c..71835d0f36 100644 > --- a/libavcodec/hevc_ps.c > +++ b/libavcodec/hevc_ps.c > @@ -464,7 +464,7 @@ int ff_hevc_decode_nal_vps(GetBitContext *gb, AVCodecContext *avctx, > if (!vps_buf) > return AVERROR(ENOMEM); > vps = (HEVCVPS*)vps_buf->data; > - > + ps->parsed_vps = 1; This would need to be reset in ff_hevc_ps_uninit(). > av_log(avctx, AV_LOG_DEBUG, "Decoding VPS\n"); > > nal_size = gb->buffer_end - gb->buffer; > @@ -1272,7 +1272,7 @@ int ff_hevc_decode_nal_sps(GetBitContext *gb, AVCodecContext *avctx, > > ret = ff_hevc_parse_sps(sps, gb, &sps_id, > apply_defdispwin, > - ps->vps_list, avctx); > + ps->parsed_vps ? ps->vps_list : NULL, avctx); If VPS is not required to parse SPS, wouldn't it be better to just change the check in ff_hevc_parse_sps() to turn the log message into a warning and then not error out? > if (ret < 0) { > av_buffer_unref(&sps_buf); > return ret; > diff --git a/libavcodec/hevc_ps.h b/libavcodec/hevc_ps.h > index 2a1bbf6489..e6b694e7f3 100644 > --- a/libavcodec/hevc_ps.h > +++ b/libavcodec/hevc_ps.h > @@ -333,6 +333,7 @@ typedef struct HEVCParamSets { > const HEVCVPS *vps; > const HEVCSPS *sps; > const HEVCPPS *pps; > + int parsed_vps; // indicates VPS has been parsed > } HEVCParamSets; > > /** _______________________________________________ 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".