Skip to content

Commit cf323d0

Browse files
author
wm4
committed
lavfi: dump the filter graph
Especially useful to see what video formats are involved on the various filter links. I suspect this function is not available on Libav, so add necessary ifdeffery preemptively.
1 parent f9f3175 commit cf323d0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

player/lavfi.c

+13
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,17 @@ static bool init_pads(struct lavfi *c)
429429
return false;
430430
}
431431

432+
static void dump_graph(struct lavfi *c)
433+
{
434+
#if LIBAVFILTER_VERSION_MICRO >= 100
435+
MP_VERBOSE(c, "Filter graph:\n");
436+
char *s = avfilter_graph_dump(c->graph, NULL);
437+
if (s)
438+
MP_VERBOSE(c, "%s\n", s);
439+
av_free(s);
440+
#endif
441+
}
442+
432443
// Initialize the graph if all inputs have formats set. If it's already
433444
// initialized, or can't be initialized yet, do nothing.
434445
static void init_graph(struct lavfi *c)
@@ -451,6 +462,8 @@ static void init_graph(struct lavfi *c)
451462
}
452463

453464
c->initialized = true;
465+
466+
dump_graph(c);
454467
}
455468
}
456469

0 commit comments

Comments
 (0)