* [FFmpeg-devel] [PATCH] avformat/avisynth: fix frameprop version check
@ 2022-02-17 0:49 Stephen Hutchinson
2022-02-18 22:14 ` Stephen Hutchinson
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hutchinson @ 2022-02-17 0:49 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Stephen Hutchinson
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".
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat/avisynth: fix frameprop version check
2022-02-17 0:49 [FFmpeg-devel] [PATCH] avformat/avisynth: fix frameprop version check Stephen Hutchinson
@ 2022-02-18 22:14 ` Stephen Hutchinson
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hutchinson @ 2022-02-18 22:14 UTC (permalink / raw)
To: FFmpeg development discussions and patches
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".
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-18 22:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17 0:49 [FFmpeg-devel] [PATCH] avformat/avisynth: fix frameprop version check Stephen Hutchinson
2022-02-18 22:14 ` Stephen Hutchinson
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git