diff mbox series

[FFmpeg-devel,10/17] af_resample: switch to child_class_iterate()

Message ID 20200528201559.22618-10-anton@khirnov.net
State Accepted
Commit 342230a53758f843ae692559c34d1b3eb35d22a4
Headers show
Series [FFmpeg-devel,01/17] Remove unnecessary use of avcodec_close().
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Anton Khirnov May 28, 2020, 8:15 p.m. UTC
---
 libavfilter/af_resample.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/libavfilter/af_resample.c b/libavfilter/af_resample.c
index e3c6a20696..785cd0c7f4 100644
--- a/libavfilter/af_resample.c
+++ b/libavfilter/af_resample.c
@@ -306,10 +306,19 @@  fail:
     return ret;
 }
 
+#if FF_API_CHILD_CLASS_NEXT
 static const AVClass *resample_child_class_next(const AVClass *prev)
 {
     return prev ? NULL : avresample_get_class();
 }
+#endif
+
+static const AVClass *resample_child_class_iterate(void **iter)
+{
+    const AVClass *c = *iter ? NULL : avresample_get_class();
+    *iter = (void*)(uintptr_t)c;
+    return c;
+}
 
 static void *resample_child_next(void *obj, void *prev)
 {
@@ -321,7 +330,10 @@  static const AVClass resample_class = {
     .class_name       = "resample",
     .item_name        = av_default_item_name,
     .version          = LIBAVUTIL_VERSION_INT,
+#if FF_API_CHILD_CLASS_NEXT
     .child_class_next = resample_child_class_next,
+#endif
+    .child_class_iterate = resample_child_class_iterate,
     .child_next       = resample_child_next,
 };