[FFmpeg-cvslog] AVIOContext: switch to child_class_iterate()

Anton Khirnov git at videolan.org
Wed Jun 10 13:53:21 EEST 2020


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed May 27 15:34:07 2020 +0200| [2cbd54451994523c334fd5ba88e16bd184701dd0] | committer: Anton Khirnov

AVIOContext: switch to child_class_iterate()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2cbd54451994523c334fd5ba88e16bd184701dd0
---

 libavformat/aviobuf.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index eb0387bdf7..5ba5de01c6 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -48,10 +48,19 @@ static void *ff_avio_child_next(void *obj, void *prev)
     return prev ? NULL : s->opaque;
 }
 
+#if FF_API_CHILD_CLASS_NEXT
 static const AVClass *ff_avio_child_class_next(const AVClass *prev)
 {
     return prev ? NULL : &ffurl_context_class;
 }
+#endif
+
+static const AVClass *child_class_iterate(void **iter)
+{
+    const AVClass *c = *iter ? NULL : &ffurl_context_class;
+    *iter = (void*)(uintptr_t)c;
+    return c;
+}
 
 #define OFFSET(x) offsetof(AVIOContext,x)
 #define E AV_OPT_FLAG_ENCODING_PARAM
@@ -67,7 +76,10 @@ const AVClass ff_avio_class = {
     .version    = LIBAVUTIL_VERSION_INT,
     .option     = ff_avio_options,
     .child_next = ff_avio_child_next,
+#if FF_API_CHILD_CLASS_NEXT
     .child_class_next = ff_avio_child_class_next,
+#endif
+    .child_class_iterate = child_class_iterate,
 };
 
 static void fill_buffer(AVIOContext *s);



More information about the ffmpeg-cvslog mailing list