1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 01:52:19 +00:00

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.
This commit is contained in:
ekisu 2019-12-06 15:00:34 -03:00 committed by wm4
parent 122bbb9ff4
commit 02d8d4e3ef

View File

@ -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);
}