From patchwork Fri Apr 28 09:55:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 41399 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dca6:b0:f3:34fa:f187 with SMTP id ky38csp1188672pzb; Fri, 28 Apr 2023 02:56:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7d1vfHQ7rl3pi4Nso1MPJ60ue6DT0MOAIS9oq6mI1cX142eRA9pDauOW0qvMEMx8DDit/R X-Received: by 2002:a17:907:7f1c:b0:953:4775:baa7 with SMTP id qf28-20020a1709077f1c00b009534775baa7mr4929020ejc.52.1682675793549; Fri, 28 Apr 2023 02:56:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682675793; cv=none; d=google.com; s=arc-20160816; b=zUFNkfQtKIvwQJxdg8l7Qensq2S8r96fMROHXpUZUPz5mCkxo4dyN2DwwOl5vVYESy DSAPPquAIwr8hRsp/XFjmHR6uAqGjy/dXbFJ1Up2tszd3sXleaZLpCurua4mF5Je3oG1 rXRO3mR7KeyemLwNpsIyZ1rA3ygEmXevdorUy+HYboG6fe9uqNYU+rGVhfQH3u76HJRl KRUrIoR4Nia5xBr6f2xVQJhYKoUkc0+t7o19BEw+y49hEmItcwmbWO1PN90+TdLCg5bs x2ZjmnNyRcSCJbrXPPIShETZ4RyzP6zLo6xn4GXGzKRHa5zCphp0B/BPGSKnlXVbycgX vTRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=3SxkUahW3cUE9bfklNsyoN0PLQO1uyKS87pM3/Zd/4E=; b=mju+xVRRxZkWIAMUBMs0mZWFPyQiRoReuYAY4UcGBgDXbaxEaI3nDasF4JoqERDfoX FmMiZ7y7eAvLrILVUyURjIMzXnQ0v9k9NHRpb9C8o0GHLcDMNaUk5UtxT5CLgynbMK2b LVzq571M71gtkrE91gPoy+XlUUS3fheiW1X8Tlj5kQQ7YGmk9toLmArUjqHDlBFOhLxn SLZm43yjbOb1Wi1Vdmlf0Q531zGA/Bc7dhOPujLJWjG0REKjO+i38XaIadPVrSPX7KVR wfEYmkYorT6U/ZNnn6vAeY9q/q2hIA57hkc99vdkAyClyLuMpjV8xI6idz9IO5MfdsFF KE0w== 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 vw13-20020a170907a70d00b009600ce55675si2739691ejc.44.2023.04.28.02.56.33; Fri, 28 Apr 2023 02:56:33 -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 E41E568BFED; Fri, 28 Apr 2023 12:55:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5FBDB68BFAE for ; Fri, 28 Apr 2023 12:55:17 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 33S9tGPS014824 for ; Fri, 28 Apr 2023 11:55:16 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id AFD43EB5BF; Fri, 28 Apr 2023 11:55:16 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Fri, 28 Apr 2023 11:55:08 +0200 Message-Id: <20230428095508.221826-8-george@nsup.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230428095508.221826-1-george@nsup.org> References: <20230428095508.221826-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Fri, 28 Apr 2023 11:55:16 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 8/8] lavf/dump: use av_disposition_write() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 8WtKUCdBDgz9 It changes the output to have underscores instead of spaces. Signed-off-by: Nicolas George --- libavformat/dump.c | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) Note: I consider the change to backspaces good: now we can copy-paste from dump directly into a command-line. diff --git a/libavformat/dump.c b/libavformat/dump.c index 96b364e337..8b55e60b6a 100644 --- a/libavformat/dump.c +++ b/libavformat/dump.c @@ -584,42 +584,7 @@ static void dump_stream_format(AVWriter wr, print_fps(wr, 1 / av_q2d(st->time_base), "tbn"); } - if (st->disposition & AV_DISPOSITION_DEFAULT) - av_writer_printf(wr, " (default)"); - if (st->disposition & AV_DISPOSITION_DUB) - av_writer_printf(wr, " (dub)"); - if (st->disposition & AV_DISPOSITION_ORIGINAL) - av_writer_printf(wr, " (original)"); - if (st->disposition & AV_DISPOSITION_COMMENT) - av_writer_printf(wr, " (comment)"); - if (st->disposition & AV_DISPOSITION_LYRICS) - av_writer_printf(wr, " (lyrics)"); - if (st->disposition & AV_DISPOSITION_KARAOKE) - av_writer_printf(wr, " (karaoke)"); - if (st->disposition & AV_DISPOSITION_FORCED) - av_writer_printf(wr, " (forced)"); - if (st->disposition & AV_DISPOSITION_HEARING_IMPAIRED) - av_writer_printf(wr, " (hearing impaired)"); - if (st->disposition & AV_DISPOSITION_VISUAL_IMPAIRED) - av_writer_printf(wr, " (visual impaired)"); - if (st->disposition & AV_DISPOSITION_CLEAN_EFFECTS) - av_writer_printf(wr, " (clean effects)"); - if (st->disposition & AV_DISPOSITION_ATTACHED_PIC) - av_writer_printf(wr, " (attached pic)"); - if (st->disposition & AV_DISPOSITION_TIMED_THUMBNAILS) - av_writer_printf(wr, " (timed thumbnails)"); - if (st->disposition & AV_DISPOSITION_CAPTIONS) - av_writer_printf(wr, " (captions)"); - if (st->disposition & AV_DISPOSITION_DESCRIPTIONS) - av_writer_printf(wr, " (descriptions)"); - if (st->disposition & AV_DISPOSITION_METADATA) - av_writer_printf(wr, " (metadata)"); - if (st->disposition & AV_DISPOSITION_DEPENDENT) - av_writer_printf(wr, " (dependent)"); - if (st->disposition & AV_DISPOSITION_STILL_IMAGE) - av_writer_printf(wr, " (still image)"); - if (st->disposition & AV_DISPOSITION_NON_DIEGETIC) - av_writer_printf(wr, " (non-diegetic)"); + av_disposition_write(wr, st->disposition, " (", ")", NULL, 0); av_writer_printf(wr, "\n"); dump_metadata(wr, st->metadata, " ");