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 4F767404D5 for ; Mon, 24 Jan 2022 17:06:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F02B368B0E2; Mon, 24 Jan 2022 19:06:22 +0200 (EET) Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8F89568A763 for ; Mon, 24 Jan 2022 19:06:16 +0200 (EET) Received: by mail-ot1-f53.google.com with SMTP id y11-20020a0568302a0b00b0059a54d66106so23150790otu.0 for ; Mon, 24 Jan 2022 09:06:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=A7AAFmZyy0K4nV333WA0TfMIQXAwldVfj5alHO0UBo0=; b=qgFRG6EZWnSRh/dqTAm6eRoc+dMNhb/TTvEP+34WBZ6+weuHfk7WJMQp2GAqpbD8IG fBOjbc4/i65JNFMroMk2fK3h7+umVwdBtI20hG/Q6yNezAM308TQjfMAvhySNxhax9vh ir+8gjfauXZ/VflKZyWJWu0GORC7KKFHWhhb/obDOgajnGcSpN9ySIjrUGIy9BU8yM6W lwMlKQKtM1GtiO7aYuT8Iknq7gM/nkToDjoshNXXoJEiffL1Kvrmr/2KubnxgEmOtr/1 una8P9WmR7naIEaHm9Xz3+6uCXRlVJqeKlfMYFYwoLZrZ/oR3OaQr275vH3VAfEa5btA R+6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=A7AAFmZyy0K4nV333WA0TfMIQXAwldVfj5alHO0UBo0=; b=K9Uo8cxxQcIBPeFpgupfLuDr7mShifLAAx/ax1IkIvcdNvuSz1XFo8vjG7HBhAKL7o INdJNNEKGuPtNkz/RpEVDY6dQkZlrMnFejvl+Xr1q+XMoEpova8+/rQa/bxEu8c4Etdu x8xhEWyDp1Nl5ADHc48b7WIEkYvTi4bC9yAuofEOfhvFysYJYD4ue5hUolXuLXJBAriH MiHi0QTsQnm2KeFRGRTWRzFI5dIoYgxNur10IUeaFhoFxguMygNnIuiW5c+fY9d1zbSH 36rpQ7W3dYk/F8RaXzKvTUytjPVys+spxfpf2NQYFYcw8m3GGI53JErFNfl4Z3UGOu/L 9ytQ== X-Gm-Message-State: AOAM532QUqeMP2zgX0r3Mg1vPlMQUvR72p/kcn2ttfFnkVxKA9Ta2JlT mfa3RJ3RYDyx4ysc2UiJM6/k2gYlcH4= X-Google-Smtp-Source: ABdhPJworlWm81xOFONLp7fjQCFlqGAuiLOX1kidufBOe9X11lFcKM7mN/YpVUS2/i6NmP9FwSZezw== X-Received: by 2002:a9d:6b01:: with SMTP id g1mr12163116otp.101.1643043974717; Mon, 24 Jan 2022 09:06:14 -0800 (PST) Received: from [192.168.0.13] ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id a19sm2102139otf.27.2022.01.24.09.06.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Jan 2022 09:06:14 -0800 (PST) Message-ID: Date: Mon, 24 Jan 2022 14:06:13 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220124170014.17189-1-anton@khirnov.net> <20220124170014.17189-2-anton@khirnov.net> From: James Almer In-Reply-To: <20220124170014.17189-2-anton@khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH 02/13] lavc/h264_parser: stop accessing H264Context 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 1/24/2022 2:00 PM, Anton Khirnov wrote: > Parsers should not mess with decoder private data. It is also completely > unnecessary here. > --- > libavcodec/h264_parser.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c > index e3a11702c5..816b04845e 100644 > --- a/libavcodec/h264_parser.c > +++ b/libavcodec/h264_parser.c > @@ -247,7 +247,6 @@ static inline int parse_nal_units(AVCodecParserContext *s, > const uint8_t * const buf, int buf_size) > { > H264ParseContext *p = s->priv_data; > - H264Context *h = avctx->priv_data; > H2645RBSP rbsp = { NULL }; > H2645NAL nal = { NULL }; > int buf_index, next_avc; > @@ -553,11 +552,10 @@ static inline int parse_nal_units(AVCodecParserContext *s, > p->last_picture_structure = s->picture_structure; > p->last_frame_num = p->poc.frame_num; > } > - if (h && sps->timing_info_present_flag) { > + if (sps->timing_info_present_flag) { > int64_t den = sps->time_scale; > - if (p->sei.unregistered.x264_build >= 0) > - h->x264_build = p->sei.unregistered.x264_build; > - if (h->x264_build < 44U) > + if (p->sei.unregistered.x264_build >= 0 && I don't think this check is needed. < 44U should in theory ensure the default of -1 is converted to unsigned and the check will evaluate to false. See my patch (I don't mind if you amend yours and push this with your authorship). > + p->sei.unregistered.x264_build < 44U) > den *= 2; > av_reduce(&avctx->framerate.den, &avctx->framerate.num, > sps->num_units_in_tick * avctx->ticks_per_frame, den, 1 << 30); _______________________________________________ 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".