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 191C04037D for ; Fri, 18 Feb 2022 22:15:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5039E68B0AD; Sat, 19 Feb 2022 00:14:58 +0200 (EET) Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com [209.85.217.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8DA4568AD96 for ; Sat, 19 Feb 2022 00:14:52 +0200 (EET) Received: by mail-vs1-f51.google.com with SMTP id w4so11541564vsq.1 for ; Fri, 18 Feb 2022 14:14:52 -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=o5x4vhtFdfU0teXXruKs/RyQnvqcU9uTR5U9yfwYTdI=; b=Ee99uD2m7fF0XbbTlQ2PUGeAedy/cAbku66bDXU0bA7tQvYbO8HpL/itVtdo/Kyqxv ap46tH6uIXJSJ+o6m5obRg8fhfaZgWEgO5kEZJDQLs9RS8bwC8Zs6xu3ayQ1rHgIeAop 27wL8e3LNpeLo+y+v7ViVcQz1vcNlwo7RGTGlH/hJwOuCtyMrxSfGstBo1Ju6Dsu0uTN gY0gzLOUPcsQvH2g+3vNnY1v1m5wBClCcik9j4PFGUcX9aCQJO/+p1spYeeFvzfcSszh Eqe7lZQYyuM5kt5N2Etdb15WWD9iJMlaaXZTPYfFIQHijXDAGHd5XK3aalEmOiCvHXRe WIrA== 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=o5x4vhtFdfU0teXXruKs/RyQnvqcU9uTR5U9yfwYTdI=; b=vAaFA+lSvvCxblRgSzReOmPKD/9iLitBnfBgnpJXW88qghrXcxrVAMyIaFVSJk213b mCTNUN6NoBTkdqSelPdEEL/dOSqhCY9ogxkoqVyyyHgwzlzAANKxr9Vc3HQ5mMZyaHg2 PvKGjNeXryGGbUMw/ZnZ7vKqTgaNbfW2H/j7ztSBuXxscnT48zzQJ0ieFMAPZyOVZpXi 8WJwVu2EDR6rC5BjSQy1yqlDWgEw04JpEDA8iwnMAMboQwoRJAcUjthXQ+iFRcQbj+XF 1CitpVXRHIUUI4DSyk7+bdzybP/KDMEY5rsyBOJBmPy3CwZ9/kug1jt2jA8xvxK4QU/E ohEQ== X-Gm-Message-State: AOAM531WbHaT99oF8WvxQAyQzVgJ3VZ329wavAHlF5tr48k/KJ09pLXL sXqQ+t3zesH4th8CMLgqxymjtV0kwsE= X-Google-Smtp-Source: ABdhPJytfj5NewFWeJjdVmRw5lvgHGe9FMRgZSIvGZBvJFUchRL0+Kn4jvCH9BsEE0xT3Gse20DHXg== X-Received: by 2002:a05:6102:3138:b0:31b:5b73:1795 with SMTP id f24-20020a056102313800b0031b5b731795mr4996210vsh.3.1645222490852; Fri, 18 Feb 2022 14:14:50 -0800 (PST) Received: from [192.168.1.5] ([75.115.109.114]) by smtp.gmail.com with ESMTPSA id w5sm7374695vkf.12.2022.02.18.14.14.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 14:14:50 -0800 (PST) Message-ID: <47ee900d-ebf1-e17d-e477-62508c338e5e@gmail.com> Date: Fri, 18 Feb 2022 17:14:50 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: FFmpeg development discussions and patches References: <20220217004949.91570-1-qyot27@gmail.com> From: Stephen Hutchinson In-Reply-To: <20220217004949.91570-1-qyot27@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH] avformat/avisynth: fix frameprop version check 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 2/16/22 7:49 PM, Stephen Hutchinson wrote: > Trying to be clever about determining between interface version 8 > and 8.1 ended up with pre-8.1 versions of AviSynth+ segfaulting. > > The amount of time between interface version 8.1 and 9 is small, > so just restrict the frameprop awareness to version 9 and call it > a day. > --- > libavformat/avisynth.c | 23 ++++++----------------- > 1 file changed, 6 insertions(+), 17 deletions(-) > > diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c > index 8bc39869a3..b345f5efe2 100644 > --- a/libavformat/avisynth.c > +++ b/libavformat/avisynth.c > @@ -502,24 +502,13 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) > /* Read AviSynth+'s frame properties to set additional info. > * > * Due to a bug preventing the C interface from accessing frame > - * properties in earlier versions of interface version 8, only > - * enable this if we detect version 8.1 at the minimum. */ > + * properties in earlier versions of interface version 8, and > + * previous attempts at being clever resulting in pre-8 versions > + * of AviSynth+ segfaulting, only enable this if we detect > + * version 9 at the minimum. Technically, 8.1 works, but the time > + * distance between 8.1 and 9 is very small, so just restrict it to 9. */ > > - if (!avs_library.avs_get_env_property) { > - av_log(s, AV_LOG_TRACE, "%s\n", > - "avs_get_env_property does not exist in AviSynth library; frame properties won't be checked."); > - frameprop = false; > - } else { > - if (avs_library.avs_get_env_property(avs->env, AVS_AEP_INTERFACE_BUGFIX)) { > - av_log(s, AV_LOG_TRACE, "%s\n", "Using interface version 8.1 or higher, reading frame properties."); > - frameprop = true; > - } else { > - av_log(s, AV_LOG_TRACE, "%s\n", "Using interface version 8.0, need 8.1+ to read frame properties."); > - frameprop = false; > - } > - } > - > - if (frameprop = true) { > + if (avs_library.avs_get_version(avs->clip) >= 9) { > > frame = avs_library.avs_get_frame(avs->clip, framedata); > avsmap = avs_library.avs_get_frame_props_ro(avs->env, frame); Pushed. _______________________________________________ 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".