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 55C0341224 for ; Thu, 17 Feb 2022 00:50:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E4A3868B1D1; Thu, 17 Feb 2022 02:50:05 +0200 (EET) Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AC98668B06E for ; Thu, 17 Feb 2022 02:49:59 +0200 (EET) Received: by mail-vs1-f54.google.com with SMTP id g21so4482025vsp.6 for ; Wed, 16 Feb 2022 16:49:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1+oqLv2gG/0UmIuWjicn628liFJc6OUZeSpD/n+heiQ=; b=CXCXjMHC4jsVTCfYXLU/5a5ndr76E+nBQpiJRC67356jelLLgbG3Hg7bN+7ofkZNs7 inEzXQX3jTGsJ6SUxYeFsqpZFWgGR9A+qn98+jwg4U/4WGwbXAW21YrGqu7JcmtXvbNA gR+fzgkYV1UkOi0SQoVD7VYKKh6HGG/WhkubJcIlQpqf93K5MRS86Iahiv7o/fTXP4WA 31mH5HM+FladmMbgTVT6l+0i485mOniJq1YRNA0PjidKZoMxwtJO8ZKJEQjxLtMIdXc5 m+5gMg3TcVI8MAnc4jy+Wre7WHIRXa0P46kBlva2SHDLseQwz9fWC8D8umKdPXalx7pz QbpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1+oqLv2gG/0UmIuWjicn628liFJc6OUZeSpD/n+heiQ=; b=Zm88nCTb15Xkx2mf+JZF01WkyjiPp2m9bFFI30YBKzcziEjFoWN7gifmmowKKzDQjb dJNJ5lDH2Ng1nzFdKo2efTQdeWSe1POlI6bdTKeFKtHY+S3h1CACag5J3BnEPHk0swyl pIuWlKls5gKcGEqAWYjX0LFoibvWhkevRy7IQ3snOyLgGRf9szTkLtv0JkyK7xi9DSx6 sEOEQ8hWoEByPk99nEI4JQC9rrSQMHoT2YkSxq120KCOfUciL0S6wUTQC6q3uNa3hGow k4+ffVSFj1jd/ysN9yiWfU2FnUrnjEEVtlMsC+D2h8+krZ7I8EHHnEK+25pF1/fd1kSa ztow== X-Gm-Message-State: AOAM531IQeRUflSd+MoCrBlFo7YyHmTsN2ySa6u95qhEmfq9WZ3Y7g+H EfhMZ+45K+SxIV0FxNW0aiweZ6BhdhE= X-Google-Smtp-Source: ABdhPJz+kSv2R49XxNlJJqrfltbtSw5k80+c1nx4lIyPbuve2dFxk1woiLzd3AwQvdoaam5YvxyrfQ== X-Received: by 2002:a05:6102:2d2:b0:31b:8f59:e2e1 with SMTP id h18-20020a05610202d200b0031b8f59e2e1mr249458vsh.69.1645058997860; Wed, 16 Feb 2022 16:49:57 -0800 (PST) Received: from cappuccino.. ([75.115.109.114]) by smtp.gmail.com with ESMTPSA id b78sm4001008vka.56.2022.02.16.16.49.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 16:49:57 -0800 (PST) From: Stephen Hutchinson To: ffmpeg-devel@ffmpeg.org Date: Wed, 16 Feb 2022 19:49:49 -0500 Message-Id: <20220217004949.91570-1-qyot27@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Subject: [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 Cc: Stephen Hutchinson 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: 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); -- 2.32.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".