From f1d161d55f458cf47e63d1ab9ddf08859019dd8a Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 12 Aug 2017 23:08:48 +0200 Subject: player: make --lavfi-complex changeable at runtime Tends to be somewhat glitchy if subtitles are enabled, and you enable and disable tracks. On error, this will disable --lavfi-complex, which will result in whatever behavior. --- player/lavfi.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'player/lavfi.c') diff --git a/player/lavfi.c b/player/lavfi.c index c597387937..ee0ca281e4 100644 --- a/player/lavfi.c +++ b/player/lavfi.c @@ -249,12 +249,19 @@ struct lavfi *lavfi_create(struct mp_log *log, char *graph_string) void lavfi_destroy(struct lavfi *c) { + if (!c) + return; free_graph(c); clear_data(c); av_frame_free(&c->tmp_frame); talloc_free(c); } +const char *lavfi_get_graph(struct lavfi *c) +{ + return c->graph_string; +} + struct lavfi_pad *lavfi_find_pad(struct lavfi *c, char *name) { for (int n = 0; n < c->num_pads; n++) { @@ -484,9 +491,11 @@ static void dump_graph(struct lavfi *c) #endif } -void lavfi_set_hwdec_devs(struct lavfi *c, struct mp_hwdec_devices *hwdevs) +void lavfi_pad_set_hwdec_devs(struct lavfi_pad *pad, + struct mp_hwdec_devices *hwdevs) { - c->hwdec_devs = hwdevs; + // We don't actually treat this per-pad. + pad->main->hwdec_devs = hwdevs; } // Initialize the graph if all inputs have formats set. If it's already -- cgit v1.2.3