mirror of
https://github.com/mpv-player/mpv
synced 2025-01-16 03:51:48 +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:
parent
122bbb9ff4
commit
02d8d4e3ef
@ -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)
|
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);
|
const AVFilter *f = avfilter_get_by_name(name);
|
||||||
return f && is_usable(f, media_type);
|
return f && is_usable(f, media_type);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user