From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 4236546D42 for ; Sat, 19 Jul 2025 09:46:33 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 4DFDB68C1AB; Sat, 19 Jul 2025 12:46:23 +0300 (EEST) Received: from nervous-mendel.212-34-160-121.plesk.page (plesk5.odn.de [212.34.167.38]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 6C41368C0E9 for ; Sat, 19 Jul 2025 12:46:16 +0300 (EEST) Received: from toolbx.fritz.box (ip-176-199-210-156.um44.pools.vodafone-ip.de [176.199.210.156]) by nervous-mendel.212-34-160-121.plesk.page (Postfix) with ESMTPSA id 095AD8C569A; Sat, 19 Jul 2025 11:46:16 +0200 (CEST) From: Andreas Hartmann To: ffmpeg-devel@ffmpeg.org Date: Sat, 19 Jul 2025 11:35:34 +0200 Message-ID: <3b804ca431e3bfc6a27618c2ed4a5a95f5f65b28.1752917734.git.hartan@7x.de> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/1] ffmpeg_opt: Parse regular options in `ffpreset` files 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: Andreas Hartmann 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: 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 --- 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".