]> git.sesse.net Git - ffmpeg/commitdiff
lavc: stop using deprecated av_codec_next()
authorJosh de Kock <josh@itanimul.li>
Tue, 14 Apr 2020 12:33:01 +0000 (13:33 +0100)
committerJosh de Kock <josh@itanimul.li>
Mon, 20 Apr 2020 15:08:20 +0000 (15:08 +0000)
Signed-off-by: Josh de Kock <josh@itanimul.li>
libavcodec/options.c
libavcodec/tests/utils.c

index 35e8ac93137273772a72f8054ef589a5f6e3e8c2..7706a0329715dca84284c4a25083e2f0e7f9341a 100644 (file)
@@ -55,15 +55,16 @@ static void *codec_child_next(void *obj, void *prev)
 
 static const AVClass *codec_child_class_next(const AVClass *prev)
 {
-    AVCodec *c = NULL;
+    void *iter = NULL;
+    const AVCodec *c = NULL;
 
     /* find the codec that corresponds to prev */
-    while (prev && (c = av_codec_next(c)))
+    while (prev && (c = av_codec_iterate(&iter)))
         if (c->priv_class == prev)
             break;
 
     /* find next codec with priv options */
-    while (c = av_codec_next(c))
+    while (c = av_codec_iterate(&iter))
         if (c->priv_class)
             return c->priv_class;
     return NULL;
index f6ba7fe66e3f96991b26a67016cab4ce6b0c228c..9232647ff0d0de03d78dd2a298ec48483796f1df 100644 (file)
 #include "libavcodec/avcodec.h"
 
 int main(void){
-    AVCodec *codec = NULL;
+    void *iter = NULL;
+    const AVCodec *codec = NULL;
     int ret = 0;
 
-    while (codec = av_codec_next(codec)) {
+    while (codec = av_codec_iterate(&iter)) {
         if (av_codec_is_encoder(codec)) {
             if (codec->type == AVMEDIA_TYPE_AUDIO) {
                 if (!codec->sample_fmts) {