- fprintf(outfile, "\"%s\" -> \"%s\"", filter_ctx_label, dst_filter_ctx_label);
- fprintf(outfile, " [ label= \"fmt:%s w:%d h:%d tb:%d/%d\" ];\n",
- av_pix_fmt_descriptors[link->format].name, link->w, link->h,
- link->time_base.num, link->time_base.den);
+ fprintf(outfile, "\"%s\" -> \"%s\"",
+ filter_ctx_label, dst_filter_ctx_label);
+ if (link->type == AVMEDIA_TYPE_VIDEO) {
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
+ fprintf(outfile,
+ " [ label= \"fmt:%s w:%d h:%d tb:%d/%d\" ]",
+ desc->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:%d cl:%s\" ]",
+ av_get_sample_fmt_name(link->format),
+ link->sample_rate, buf);
+ }
+ fprintf(outfile, ";\n");