From: Andreas Hartmann <hartan@7x.de> To: ffmpeg-devel@ffmpeg.org Cc: Andreas Hartmann <hartan@7x.de> Subject: [FFmpeg-devel] [PATCH 1/1] ffmpeg_opt: Parse regular options in `ffpreset` files Date: Sat, 19 Jul 2025 11:35:34 +0200 Message-ID: <3b804ca431e3bfc6a27618c2ed4a5a95f5f65b28.1752917734.git.hartan@7x.de> (raw) In-Reply-To: <cover.1752917734.git.hartan@7x.de> instead of only AV-specific options. The previous code assumed that any option not defining the codec in an `ffpreset` file is an AVOption. This for example prevented the use of options defined in `OptionDef[]`, like `-pix_fmt`, as part of preset files, requiring users to type these out every time. Closes: #1530 Signed-off-by: Andreas Hartmann <hartan@7x.de> --- fftools/ffmpeg_opt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git (-)/fftools/ffmpeg_opt.c (+)/fftools/ffmpeg_opt.c index d714a152..926a8bda 100644 --- (-)/fftools/ffmpeg_opt.c +++ (+)/fftools/ffmpeg_opt.c @@ -1050,7 +1050,8 @@ static int opt_preset(void *optctx, const char *opt, const char *arg) else if (!strcmp(key, "vcodec")) opt_video_codec (o, key, value); else if (!strcmp(key, "scodec")) opt_subtitle_codec(o, key, value); else if (!strcmp(key, "dcodec")) opt_data_codec (o, key, value); - else if (opt_default_new(o, key, value) < 0) { + else if ((parse_option(o, key, value, options) < 0) && + (opt_default_new(o, key, value) < 0)) { av_log(NULL, AV_LOG_FATAL, "%s: Invalid option or argument: '%s', parsed as '%s' = '%s'\n", filename, line, key, value); ret = AVERROR(EINVAL); _______________________________________________ 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".
prev parent reply other threads:[~2025-07-19 9:46 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-07-19 9:35 [FFmpeg-devel] [PATCH 0/1] Fix option parsing in ffpreset files Andreas Hartmann 2025-07-19 9:35 ` Andreas Hartmann [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=3b804ca431e3bfc6a27618c2ed4a5a95f5f65b28.1752917734.git.hartan@7x.de \ --to=hartan@7x.de \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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