fftools/opt_cmdutils: fix printing known channel layouts
Look for the generic "USR" labels instead of "?" to skip channels with no known names, and actually print the decomposition of standard channel layouts. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -997,7 +997,7 @@ int show_layouts(void *optctx, const char *opt, const char *arg)
|
|||||||
"NAME DESCRIPTION\n");
|
"NAME DESCRIPTION\n");
|
||||||
for (i = 0; i < 63; i++) {
|
for (i = 0; i < 63; i++) {
|
||||||
av_channel_name(buf, sizeof(buf), i);
|
av_channel_name(buf, sizeof(buf), i);
|
||||||
if (!strcmp(buf, "?"))
|
if (strstr(buf, "USR"))
|
||||||
continue;
|
continue;
|
||||||
av_channel_description(buf2, sizeof(buf2), i);
|
av_channel_description(buf2, sizeof(buf2), i);
|
||||||
printf("%-14s %s\n", buf, buf2);
|
printf("%-14s %s\n", buf, buf2);
|
||||||
@@ -1006,11 +1006,14 @@ int show_layouts(void *optctx, const char *opt, const char *arg)
|
|||||||
"NAME DECOMPOSITION\n");
|
"NAME DECOMPOSITION\n");
|
||||||
while (ch_layout = av_channel_layout_standard(&iter)) {
|
while (ch_layout = av_channel_layout_standard(&iter)) {
|
||||||
av_channel_layout_describe(ch_layout, buf, sizeof(buf));
|
av_channel_layout_describe(ch_layout, buf, sizeof(buf));
|
||||||
av_channel_name(buf2, sizeof(buf2), i);
|
|
||||||
printf("%-14s ", buf);
|
printf("%-14s ", buf);
|
||||||
for (i = 0; i < 63; i++)
|
for (i = 0; i < 63; i++) {
|
||||||
if (av_channel_layout_index_from_channel(ch_layout, i) >= 0)
|
int idx = av_channel_layout_index_from_channel(ch_layout, i);
|
||||||
printf("%s%s", i ? "+" : "", buf2);
|
if (idx >= 0) {
|
||||||
|
av_channel_name(buf2, sizeof(buf2), i);
|
||||||
|
printf("%s%s", idx ? "+" : "", buf2);
|
||||||
|
}
|
||||||
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user