summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorekisu <dts.ramon@gmail.com>2019-12-06 15:00:34 -0300
committerwm4 <1387750+wm4@users.noreply.github.com>2019-12-06 19:12:57 +0100
commit02d8d4e3efdc0297e9a7395b53d5b5893be4dd52 (patch)
tree02d8cfb112c79564925f7131208b729b3d9531cc
parent122bbb9ff47ee06e816b7e0dd7219e0c7533edf1 (diff)
downloadmpv-02d8d4e3efdc0297e9a7395b53d5b5893be4dd52.tar.bz2
mpv-02d8d4e3efdc0297e9a7395b53d5b5893be4dd52.tar.xz
f_lavfi: mp_lavfi_is_usable: check for "lavfi-" prefix
Without this, adding filters with the prefix would fail, and some filters that have conflicting names with mpv ones were unusable.
-rw-r--r--filters/f_lavfi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/filters/f_lavfi.c b/filters/f_lavfi.c
index 23af326c9b..f4f68ba0af 100644
--- a/filters/f_lavfi.c
+++ b/filters/f_lavfi.c
@@ -943,6 +943,10 @@ static bool is_usable(const AVFilter *filter, int media_type)
bool mp_lavfi_is_usable(const char *name, int media_type)
{
+ // Skip the lavfi- prefix, if present.
+ if (strncmp(name, "lavfi-", 6) == 0)
+ name += 6;
+
const AVFilter *f = avfilter_get_by_name(name);
return f && is_usable(f, media_type);
}