PR #26386 opened by Forgejo_Fairy URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26386 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26386.patch
After 0af7c262a12b, opening a trusted AviSynth script by filename can produce only the generic invalid-data error. Address the diagnostic requested in #26309 by mentioning explicit demuxer selection when format probing fails for a `.avs` filename and the build includes the AviSynth demuxer. The message conditions the advice on the caller knowing the file is a trusted script. Tested with AviSynth+ 3.7.6 on Linux AArch64. A one-line `BlankClip` script produced the hint once, including with an uppercase `.AVS` suffix. Explicit `-f avisynth` opened the script, and the Creature Shock FATE sample `OUTATIME.AVS` was identified as `avs`. Missing files, an unrecognized `.txt` input, and a build without AviSynth support produced no AviSynth hint. >From b87af675c1a1ef0121ea103f63009fe4f6b0e969 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer <[email protected]> Date: Thu, 26 Nov 2026 21:47:39 +0000 Subject: [PATCH] avformat: hint at explicit AviSynth selection after a failed probe AviSynth scripts need explicit demuxer selection, but a failed probe only reports invalid data. Mention the demuxer for unrecognized .avs inputs when AviSynth support is built in. Qualify the hint so the extension alone is never taken as a reason to execute a script. Assisted-by: Fairy --- libavformat/format.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/format.c b/libavformat/format.c index a412312ebcd..0bda650d51c 100644 --- a/libavformat/format.c +++ b/libavformat/format.c @@ -357,8 +357,13 @@ int av_probe_input_buffer2(AVIOContext *pb, const AVInputFormat **fmt, } } - if (!*fmt) + if (!*fmt) { + if (CONFIG_AVISYNTH_DEMUXER && av_match_ext(filename, "avs")) + av_log(logctx, AV_LOG_WARNING, + "If this is a trusted AviSynth script, select the avisynth demuxer " + "explicitly (-f avisynth before -i on the command line).\n"); ret = AVERROR_INVALIDDATA; + } fail: /* Rewind. Reuse probe buffer to avoid seeking. */ -- 2.54.1 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
