[FFmpeg-devel] [PATCH] cmdutils: Add some whitespace when printing layouts

Tobias Rapp t.rapp at noa-audio.com
Tue Sep 2 17:04:31 CEST 2014


Attached patch adds some whitespace when listing channel layouts with 
the "-layouts" option.

== Output before patch ==

Individual channels:
NAME        DESCRIPTION
FL          front left
FR          front right
FC          front center
[...]

Standard channel layouts:
NAME        DECOMPOSITION
mono        FC
stereo      FL+FR
2.1         FL+FR+LFE
[...]
7.1(wide)   FL+FR+FC+LFE+BL+BR+FLC+FRC
7.1(wide-side)FL+FR+FC+LFE+FLC+FRC+SL+SR
octagonal   FL+FR+FC+BL+BR+BC+SL+SR
downmix     DL+DR


== Output after patch ==

Individual channels:
NAME           DESCRIPTION
FL             front left
FR             front right
FC             front center
[...]

Standard channel layouts:
NAME           DECOMPOSITION
mono           FC
stereo         FL+FR
2.1            FL+FR+LFE
[...]
7.1(wide)      FL+FR+FC+LFE+BL+BR+FLC+FRC
7.1(wide-side) FL+FR+FC+LFE+FLC+FRC+SL+SR
octagonal      FL+FR+FC+BL+BR+BC+SL+SR
downmix        DL+DR

-------------- next part --------------
>From 4bb45eaf4f0b404348e9f72a1a0bbb30551322d8 Mon Sep 17 00:00:00 2001
From: Tobias Rapp <t.rapp at noa-audio.com>
Date: Tue, 2 Sep 2014 16:20:45 +0200
Subject: [PATCH] cmdutils: Add some whitespace when printing layouts

Adds some more whitespace between channel layout name and decomposition.
---
 cmdutils.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cmdutils.c b/cmdutils.c
index a71c7db..1143ea1 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -1639,19 +1639,19 @@ int show_layouts(void *optctx, const char *opt, const char *arg)
     const char *name, *descr;
 
     printf("Individual channels:\n"
-           "NAME        DESCRIPTION\n");
+           "NAME           DESCRIPTION\n");
     for (i = 0; i < 63; i++) {
         name = av_get_channel_name((uint64_t)1 << i);
         if (!name)
             continue;
         descr = av_get_channel_description((uint64_t)1 << i);
-        printf("%-12s%s\n", name, descr);
+        printf("%-14s %s\n", name, descr);
     }
     printf("\nStandard channel layouts:\n"
-           "NAME        DECOMPOSITION\n");
+           "NAME           DECOMPOSITION\n");
     for (i = 0; !av_get_standard_channel_layout(i, &layout, &name); i++) {
         if (name) {
-            printf("%-12s", name);
+            printf("%-14s ", name);
             for (j = 1; j; j <<= 1)
                 if ((layout & j))
                     printf("%s%s", (layout & (j - 1)) ? "+" : "", av_get_channel_name(j));
-- 
1.9.1



More information about the ffmpeg-devel mailing list