[FFmpeg-cvslog] lavc: stop using deprecated av_codec_next()

Josh de Kock git at videolan.org
Mon Apr 20 18:43:22 EEST 2020


ffmpeg | branch: master | Josh de Kock <josh at itanimul.li> | Tue Apr 14 13:33:01 2020 +0100| [bd2e7b74e1ed1bb050cabc46925ba65f6d87d351] | committer: Josh de Kock

lavc: stop using deprecated av_codec_next()

Signed-off-by: Josh de Kock <josh at itanimul.li>

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

 libavcodec/options.c     | 7 ++++---
 libavcodec/tests/utils.c | 5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavcodec/options.c b/libavcodec/options.c
index 35e8ac9313..7706a03297 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -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;
diff --git a/libavcodec/tests/utils.c b/libavcodec/tests/utils.c
index f6ba7fe66e..9232647ff0 100644
--- a/libavcodec/tests/utils.c
+++ b/libavcodec/tests/utils.c
@@ -19,10 +19,11 @@
 #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) {



More information about the ffmpeg-cvslog mailing list