summaryrefslogtreecommitdiffstats
path: root/player/lavfi.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-08-12 23:08:48 +0200
committerwm4 <wm4@nowhere>2017-08-12 23:10:40 +0200
commitf1d161d55f458cf47e63d1ab9ddf08859019dd8a (patch)
treeccd0fad41aefdf59b9ec00652edc829c3f81a424 /player/lavfi.c
parentbaead23ea06307af0d0a7acd21307d8f723b3a1b (diff)
downloadmpv-f1d161d55f458cf47e63d1ab9ddf08859019dd8a.tar.bz2
mpv-f1d161d55f458cf47e63d1ab9ddf08859019dd8a.tar.xz
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.
Diffstat (limited to 'player/lavfi.c')
-rw-r--r--player/lavfi.c13
1 files changed, 11 insertions, 2 deletions
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