[FFmpeg-devel] [PATCH 3/3] avformat/options: Update to new iterating API

Zhao, Gang gang.zhao.42 at gmail.com
Sat May 9 11:50:49 EEST 2020


Signed-off-by: Zhao, Gang <gang.zhao.42 at gmail.com>
---
 libavformat/options.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git libavformat/options.c libavformat/options.c
index e14510504f..cec6ee3621 100644
--- libavformat/options.c
+++ libavformat/options.c
@@ -55,26 +55,28 @@ static void *format_child_next(void *obj, void *prev)
 
 static const AVClass *format_child_class_next(const AVClass *prev)
 {
-    AVInputFormat  *ifmt = NULL;
-    AVOutputFormat *ofmt = NULL;
+    const AVInputFormat  *ifmt;
+    const AVOutputFormat *ofmt;
+    void *demuxer_opaque = NULL;
+    void *muxer_opaque = NULL;
 
     if (!prev)
         return &ff_avio_class;
 
-    while ((ifmt = av_iformat_next(ifmt)))
+    while ((ifmt = av_demuxer_iterate(&demuxer_opaque)))
         if (ifmt->priv_class == prev)
             break;
 
     if (!ifmt)
-        while ((ofmt = av_oformat_next(ofmt)))
+        while ((ofmt = av_muxer_iterate(&muxer_opaque)))
             if (ofmt->priv_class == prev)
                 break;
     if (!ofmt)
-        while (ifmt = av_iformat_next(ifmt))
+        while (ifmt = av_demuxer_iterate(&demuxer_opaque))
             if (ifmt->priv_class)
                 return ifmt->priv_class;
 
-    while (ofmt = av_oformat_next(ofmt))
+    while (ofmt = av_muxer_iterate(&muxer_opaque))
         if (ofmt->priv_class)
             return ofmt->priv_class;
 
-- 
2.17.1



More information about the ffmpeg-devel mailing list