diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 88e39bf720cc16a7be79b5710183cba6637152f9..68e0f2c215674f9988752ba673ee11c25f1dfac8 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -272,6 +272,9 @@ int ff_poll_frame(AVFilterLink *link) static AVFilter *first_filter; +#if !FF_API_NOCONST_GET_NAME +const +#endif AVFilter *avfilter_get_by_name(const char *name) { AVFilter *f = NULL; diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index ca11be9bc6a459f14b714f0028d34d185a6f2d83..9f14afdbc57cd07f5b6bc5cc721cd96cf407e361 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -764,6 +764,9 @@ int avfilter_register(AVFilter *filter); * @return the filter definition, if any matching one is registered. * NULL if none found. */ +#if !FF_API_NOCONST_GET_NAME +const +#endif AVFilter *avfilter_get_by_name(const char *name); /** diff --git a/libavfilter/version.h b/libavfilter/version.h index 9c84e0f85ac67f512a42b06b20566f525e432f9b..02f348ebb78f3e1100817cdf5c5eee2a11136d9c 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -68,5 +68,8 @@ #ifndef FF_API_OLD_FILTER_REGISTER #define FF_API_OLD_FILTER_REGISTER (LIBAVFILTER_VERSION_MAJOR < 4) #endif +#ifndef FF_API_NOCONST_GET_NAME +#define FF_API_NOCONST_GET_NAME (LIBAVFILTER_VERSION_MAJOR < 4) +#endif #endif /* AVFILTER_VERSION_H */