From patchwork Wed Jul 12 09:06:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= X-Patchwork-Id: 4306 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp542272vsb; Wed, 12 Jul 2017 02:07:22 -0700 (PDT) X-Received: by 10.28.153.21 with SMTP id b21mr1779803wme.96.1499850442037; Wed, 12 Jul 2017 02:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499850442; cv=none; d=google.com; s=arc-20160816; b=ehqhcb9HyIH/4K0zn+8l4bE6SXuH+0BuLmzfwn8BCwcss6TTM7tKkfMO9TQSnhAvZT 4C9lbiUIEumRFmEDrZDzf6Lbe3YoZ2z6eapthHie3JAu4FZvEX46wHq7y2WA5pwc+tt/ ZEqfmJs7l53dnOxeRyiwDgyZiJPMowHu+A2tSusIEI04apf/BD0DRxpcwu+paDNO5a9M m6anH3iyBesZVbfksmwl8Bh3ypkL9QQqBOxklv5c2rd7fXS1uiHnHkqfZHSqSJZjlqCu 3FgEXFPM1gTLsWRnSfq6eZELwWUvCAuJS3TNQLZzbbJcn0RMMdtsMQho9kcrEbjAA5YR wL8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=RRkoh2uS46Unfmiz53LQhvo2rG/gWRYTkq/0GqAFHvE=; b=HCvHiQckd9O9T39OateD+XWoZlKLu8O7pL3EaHliwTR33aSMkKo5GeLJIDvmdppEV6 C+z0+ME/877kBKsbD5Z1+6yVStel/BdPXFud9ECtWoYx3ZJobBKSqv0S+ydBuJ4F0Cr3 Ennfd8BmXxB3xRRpcc2iNLCSLIr3MINuuSJ7UBMM/CHqLRTMeBRF3vD3ybXG59DqwthP zGX+rFC+ZYlwnq0xYZ2tcH6QFpeWxHCS5X1Ipyg/Zxh0IR9xS4M8Fm9qp5OEcj0zD+kv H8vfVOQGdZBqPz4IcYKEdjrRXR4BIN4K5S7oHpIbXm/NKuz1Rmz0d0NaDVvRoTEe4fat aT5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t187si1693861wmf.184.2017.07.12.02.07.21; Wed, 12 Jul 2017 02:07:21 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3293B689CFA; Wed, 12 Jul 2017 12:07:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from golem.pkh.me (LStLambert-657-1-117-164.w92-154.abo.wanadoo.fr [92.154.28.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AB4D0689C89 for ; Wed, 12 Jul 2017 12:07:01 +0300 (EEST) Received: from localhost (golem.pkh.me [local]) by golem.pkh.me (OpenSMTPD) with ESMTPA id 2fab6713; Wed, 12 Jul 2017 09:07:01 +0000 (UTC) From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Jul 2017 11:06:53 +0200 Message-Id: <20170712090655.2964-2-u@pkh.me> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170712090655.2964-1-u@pkh.me> References: <20170712090655.2964-1-u@pkh.me> Subject: [FFmpeg-devel] [PATCH 2/3] ffprobe: add -(no)find_stream_info expert option 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 Cc: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- ffprobe.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ffprobe.c b/ffprobe.c index e295c53def..72a06d983b 100644 --- a/ffprobe.c +++ b/ffprobe.c @@ -130,6 +130,8 @@ typedef struct ReadInterval { static ReadInterval *read_intervals; static int read_intervals_nb = 0; +static int find_stream_info = 1; + /* section structure definition */ #define SECTION_MAX_NB_CHILDREN 10 @@ -2771,10 +2773,9 @@ static void show_error(WriterContext *w, int err) static int open_input_file(InputFile *ifile, const char *filename) { - int err, i, orig_nb_streams; + int err, i; AVFormatContext *fmt_ctx = NULL; AVDictionaryEntry *t; - AVDictionary **opts; int scan_all_pmts_set = 0; fmt_ctx = avformat_alloc_context(); @@ -2802,10 +2803,11 @@ static int open_input_file(InputFile *ifile, const char *filename) return AVERROR_OPTION_NOT_FOUND; } - /* fill the streams in the format context */ - opts = setup_find_stream_info_opts(fmt_ctx, codec_opts); - orig_nb_streams = fmt_ctx->nb_streams; + if (find_stream_info) { + AVDictionary **opts = setup_find_stream_info_opts(fmt_ctx, codec_opts); + int orig_nb_streams = fmt_ctx->nb_streams; + // TODO: reindent err = avformat_find_stream_info(fmt_ctx, opts); for (i = 0; i < orig_nb_streams; i++) @@ -2816,6 +2818,7 @@ static int open_input_file(InputFile *ifile, const char *filename) print_error(filename, err); return err; } + } av_dump_format(fmt_ctx, 0, filename, 0); @@ -3472,6 +3475,8 @@ static const OptionDef real_options[] = { { "read_intervals", HAS_ARG, {.func_arg = opt_read_intervals}, "set read intervals", "read_intervals" }, { "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {.func_arg = opt_default}, "generic catch all option", "" }, { "i", HAS_ARG, {.func_arg = opt_input_file_i}, "read specified file", "input_file"}, + { "find_stream_info", OPT_BOOL | OPT_INPUT | OPT_EXPERT, { &find_stream_info }, + "read and decode the streams to fill missing information with heuristics" }, { NULL, }, };