diff mbox series

[FFmpeg-devel,09/17] af_aresample: switch to child_class_iterate()

Message ID 20200528201559.22618-9-anton@khirnov.net
State Accepted
Commit 3dd324427a5de2bf0074e10c1e37986b0327107d
Headers show
Series [FFmpeg-devel,01/17] Remove unnecessary use of avcodec_close(). | expand

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_aresample.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index ef10621c35..fb10bd1c33 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -293,10 +293,19 @@  static int request_frame(AVFilterLink *outlink)
     return ret;
 }
 
+#if FF_API_CHILD_CLASS_NEXT
 static const AVClass *resample_child_class_next(const AVClass *prev)
 {
     return prev ? NULL : swr_get_class();
 }
+#endif
+
+static const AVClass *resample_child_class_iterate(void **iter)
+{
+    const AVClass *c = *iter ? NULL : swr_get_class();
+    *iter = (void*)(uintptr_t)c;
+    return c;
+}
 
 static void *resample_child_next(void *obj, void *prev)
 {
@@ -317,7 +326,10 @@  static const AVClass aresample_class = {
     .item_name        = av_default_item_name,
     .option           = options,
     .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,
 };