summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-02-13 22:50:47 +0100
committerJanne Grunau <janne-ffmpeg@jannau.net>2011-02-17 00:02:11 +0100
commit009026efb1e3b3a5f05fd9934019a6300b25f364 (patch)
tree9416bbce2d0fbef866906486f33661739d36b4f2 /tools
parent6c60fcf89afc84c9dc863669d78e611d7c72fe41 (diff)
downloadffmpeg-009026efb1e3b3a5f05fd9934019a6300b25f364.tar.gz
In graph2dot, print more specific audio information for audio links.
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/graph2dot.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/tools/graph2dot.c b/tools/graph2dot.c
index 5e0da9a516..b67e597098 100644
--- a/tools/graph2dot.c
+++ b/tools/graph2dot.c
@@ -22,6 +22,7 @@
#undef HAVE_AV_CONFIG_H
#include "libavutil/pixdesc.h"
+#include "libavutil/audioconvert.h"
#include "libavfilter/avfiltergraph.h"
static void usage(void)
@@ -67,10 +68,18 @@ static void print_digraph(FILE *outfile, AVFilterGraph *graph)
dst_filter_ctx->filter->name);
fprintf(outfile, "\"%s\" -> \"%s\"", filter_ctx_label, dst_filter_ctx_label);
- fprintf(outfile, " [ label= \"fmt:%s w:%d h:%d tb:%d/%d\" ];\n",
- link->type == AVMEDIA_TYPE_VIDEO ? av_pix_fmt_descriptors[link->format].name :
- link->type == AVMEDIA_TYPE_AUDIO ? av_get_sample_fmt_name(link->format) : "unknown",
- link->w, link->h, link->time_base.num, link->time_base.den);
+ if (link->type == AVMEDIA_TYPE_VIDEO) {
+ fprintf(outfile, " [ label= \"fmt:%s w:%d h:%d tb:%d/%d\" ]",
+ av_pix_fmt_descriptors[link->format].name,
+ link->w, link->h, link->time_base.num, link->time_base.den);
+ } else if (link->type == AVMEDIA_TYPE_AUDIO) {
+ char buf[255];
+ av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);
+ fprintf(outfile, " [ label= \"fmt:%s sr:%"PRId64" cl:%s\" ]",
+ av_get_sample_fmt_name(link->format),
+ link->sample_rate, buf);
+ }
+ fprintf(outfile, ";\n");
}
}
}