From patchwork Thu Feb 17 00:49:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hutchinson X-Patchwork-Id: 34348 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:d078:0:0:0:0 with SMTP id x24csp195406nkx; Wed, 16 Feb 2022 16:50:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8Ux0KEoN3n90kUXABI8iVXazWfDkqQ+4zYLSJkyOaDEWcZ9OQos4cxgDjGbNuzDvRpqxc X-Received: by 2002:a50:9f68:0:b0:410:d013:250b with SMTP id b95-20020a509f68000000b00410d013250bmr321193edf.21.1645059011304; Wed, 16 Feb 2022 16:50:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645059011; cv=none; d=google.com; s=arc-20160816; b=WsS+eXSj1uMDzbMohWowsbrVXfqj9vDY3Pdn/hYB+/7luCPwbQzi+Pq2VUqutVFQ9g U0SLajDwdHL+9Ipa5s8PFRaRxnhAHGqrlXlNf+XwBmphoijN9hBZioOcorqRGJjQq95n DqyhmhCbnfVX147vPWMyR9hT4Yjl+andNQwNFdNgsIH1a0kPVUPi+GLZfQky5019eMUc YWpWJ3fqJ0IN4mL3spqr/a9xNITK5JjX5BORDFtNPFHMgEhJT1OzTr22cBu9AyxWq+Uc 93sjEsxE+vX6Iuza7kJENXbh8souc/8O9lAdXSjBXnsFywIDRYy20zqj7ljhfF1YVntr lIPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=MGHXPOASYjKuDl4MnzxbQ8OXnVrw6YUwHo+1ZHlJbG0=; b=IrdfrXQBK0neStg2/NZCcKLtWyfOw/LPeqJ8jonf/KcIvkhbBsbViYWOBLCMCtOz8Y w0AAwYMci1EwUeoz3avJYnVPPmSqC1Lfgl0VXiqqCtTCrWEJH7Pe0pIstGtlVD/akoP6 lYBmylQP+5CYnbHxTrWwQ4JL4HA99Gt1Ay4p59SAJzFwtTLweDQi2be7ujVLZeZ//ZKt 8LplxIpKCu6sGiYLhI1Aoz1yKpHaPxE5wtJl4+VYTGNAcuDbkGk5AM73Cbmfe4vXAGGO sT2f6wjvZZlaKX9hS+KCloXSGXtLQ6LMGQ9tI1n1AOR1GZ59kUBdNHFKO9KGBwXEDXEr x2fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=CXCXjMHC; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id gt17si1012598ejc.562.2022.02.16.16.50.10; Wed, 16 Feb 2022 16:50:11 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=CXCXjMHC; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2A44168B1E0; Thu, 17 Feb 2022 02:50:06 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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-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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 1OOCDwmznIOp 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);