From patchwork Sun Jun 28 20:58:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Buitenhuis X-Patchwork-Id: 20676 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 3B2E244AFE6 for ; Sun, 28 Jun 2020 23:58:28 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1CB3F68B806; Sun, 28 Jun 2020 23:58:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7FB2868B6DF for ; Sun, 28 Jun 2020 23:58:21 +0300 (EEST) Received: by mail-wm1-f68.google.com with SMTP id g75so13523508wme.5 for ; Sun, 28 Jun 2020 13:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=QT4wCwbfzU2pKucFjp3ZHdYo/wefd4pwqNVK4b6c6bM=; b=Fi2sWn0E5PndOV5pTbJC5VljcD8UBH81lD/4emAFcuWWtGFyTl4MIUvcliU/0NUDbw J2yRPRLOSSOiDBupGtNzzF4CXPXvF9SKg1IBI/FreFdUy0MLEepqf/FSSprjH7My27NX Mjhrg+Q6GIHUnp2dfk+iI3kPp4N3Ay41UGIkE1KJdn/c/Hq2ZRjWbCxXlGpDKELPXp+Z BgiM/0J8lV9o5ZVOQ4BT2vWxYbIaAHqlLWsgh+gBkCiXYe8szWyirp4jiKeYmrvP83As 9u6rgQHLjT3EC3WNPS+nxukdgYiypvxJBz8GHas9jUK52sS/8XB8S6KIFePnVN9Cee1v dgJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=QT4wCwbfzU2pKucFjp3ZHdYo/wefd4pwqNVK4b6c6bM=; b=eksADPV2sFGDAfoF59aWDOztBpN/pOiopz1ZFWLc0KU4W1DiD0QmkWAdIFbpIWkYNF VWtH9IPFDxxupQtEKWTnXmueJ21G3GWDJjOHBbIVqokcxo2BJVwx65G9WM4UTae+zW5x dNevjvk4OA/YI+tujuUSMGSgrNx99NplxXaKZ45UPC9W/QBqZuowsodocYoqnVrF3PTf NQYP44vBvCfEX/DZNY3zI6/tTvLgWcdkZLCrxc5lL14qlE8F+tn1z2fj9s1W+VYYPUvk 3KLmnhT5cto7DumScUF4R4z6IgXyNB9t6pZoCkhzhIWAgUnPu9qRZLMBgptFkhY6w5wd nQvQ== X-Gm-Message-State: AOAM530PGEvDnqR4OFcJTKehIdxbxpimndP3J4V1xFwrdahuNXq4pceN kJzF/apo/EwfTe+3DgmX8rl+DvJy X-Google-Smtp-Source: ABdhPJyptGbodv04+dB0MSt2cNH9V3Oj5cJgXIWCtKV5GLCCBK9NkmskQkc5Y1OaM127eXwgHnHXuA== X-Received: by 2002:a1c:9e84:: with SMTP id h126mr3887635wme.61.1593377900593; Sun, 28 Jun 2020 13:58:20 -0700 (PDT) Received: from localhost.localdomain ([82.129.83.65]) by smtp.gmail.com with ESMTPSA id h84sm2613962wme.22.2020.06.28.13.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jun 2020 13:58:20 -0700 (PDT) From: Derek Buitenhuis To: ffmpeg-devel@ffmpeg.org Date: Sun, 28 Jun 2020 21:58:09 +0100 Message-Id: <20200628205809.721321-1-derek.buitenhuis@gmail.com> X-Mailer: git-send-email 2.27.0.rc2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] ffprobe: Allow unknown format private AVOptions X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This useful, because by ffprobe's very nature, you use it to probe a file and find out what it is. Requiring every format private option to be known to the demuxer forces one to run ffprobe twice, if one wants to use ffprobe in a generic way. For example, say one wants to probe all user-uploaded files, while also ignoring edit lists for any MP4s that are uploaded. Currently, you'd have to run ffprobe twice: once to identify the format, and once again to actually probe the metadata you want. After this patch, you could set -ignore_editlist 1 on every call and only probe once. Signed-off-by: Derek Buitenhuis --- Changed to just be the main behavior instead of behind an option, as Michael suggested. Didn't really know what would be added to ffprobe.texi, though, since this is no longer an option. --- fftools/ffprobe.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 5515e1b31b..61191add6b 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2879,10 +2879,8 @@ static int open_input_file(InputFile *ifile, const char *filename, ifile->fmt_ctx = fmt_ctx; if (scan_all_pmts_set) av_dict_set(&format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE); - if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) { - av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key); - return AVERROR_OPTION_NOT_FOUND; - } + if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) + av_log(NULL, AV_LOG_WARNING, "Option %s skipped - not known to demuxer.\n", t->key); if (find_stream_info) { AVDictionary **opts = setup_find_stream_info_opts(fmt_ctx, codec_opts);