History

lavfi: deprecate avfilter_link_free()

It never makes sense for this function to be called by users.

Anton Khirnov committed 2 years ago

Commit 6b1f41e1 parent c0aee393 files · +15 −3Browse files

Unified · Split

3 files
  1. libavfilter/avfilter.c +9 −2
  2. libavfilter/avfilter.h +4 −1
  3. libavfilter/version_major.h +2 −0
libavfilter/avfilter.c+9−2
@@ -192,7 +192,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, · 191 unmodified lines
192192 return 0;
193193 }
194194
195−void avfilter_link_free(AVFilterLink **link)
195+static void link_free(AVFilterLink **link)
196196 {
197197 FilterLinkInternal *li;
198198
@@ -207,6 +207,13 @@ void avfilter_link_free(AVFilterLink **link) · 8 unmodified lines
207207 av_freep(link);
208208 }
209209
210+#if FF_API_LINK_PUBLIC
211+void avfilter_link_free(AVFilterLink **link)
212+{
213+ link_free(link);
214+}
215+#endif
216+
210217 static void update_link_current_pts(FilterLinkInternal *li, int64_t pts)
211218 {
212219 AVFilterLink *const link = &li->l;
@@ -763,7 +770,7 @@ static void free_link(AVFilterLink *link) · 550 unmodified lines
763770 ff_formats_unref(&link->outcfg.samplerates);
764771 ff_channel_layouts_unref(&link->incfg.channel_layouts);
765772 ff_channel_layouts_unref(&link->outcfg.channel_layouts);
766− avfilter_link_free(&link);
773+ link_free(&link);
767774 }
768775
769776 void avfilter_free(AVFilterContext *filter)
libavfilter/avfilter.h+4−1
@@ -676,10 +676,13 @@ struct AVFilterLink { · 675 unmodified lines
676676 int avfilter_link(AVFilterContext *src, unsigned srcpad,
677677 AVFilterContext *dst, unsigned dstpad);
678678
679+#if FF_API_LINK_PUBLIC
679680 /**
680− * Free the link in *link, and set its pointer to NULL.
681+ * @deprecated this function should never be called by users
681682 */
683+attribute_deprecated
682684 void avfilter_link_free(AVFilterLink **link);
685+#endif
683686
684687 /**
685688 * Negotiate the media format, dimensions, etc of all inputs to a filter.
libavfilter/version_major.h+2−0
@@ -35,4 +35,6 @@ · 34 unmodified lines
3535 * the public API and may change, break or disappear at any time.
3636 */
3737
38+#define FF_API_LINK_PUBLIC (LIBAVFILTER_VERSION_MAJOR < 11)
39+
3840 #endif /* AVFILTER_VERSION_MAJOR_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t