diff mbox series

[FFmpeg-devel,3/5] avcodec/tests/codec_desc: Test for every AVCodec to have a descriptor

Message ID AM7PR03MB6660395E0BE9B2B4C57423AF8FA19@AM7PR03MB6660.eurprd03.prod.outlook.com
State Superseded
Headers show
Series [FFmpeg-devel,1/5] avcodec/mlpenc: Set AV_PKT_FLAG_KEY manually
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 21, 2021, 10:18 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/tests/codec_desc.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/tests/codec_desc.c b/libavcodec/tests/codec_desc.c
index c9b3497343..378e4c637f 100644
--- a/libavcodec/tests/codec_desc.c
+++ b/libavcodec/tests/codec_desc.c
@@ -16,11 +16,14 @@ 
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "libavcodec/avcodec.h"
+#include "libavcodec/codec.h"
+#include "libavcodec/codec_desc.h"
 
 int main(int argc, char **argv)
 {
     const AVCodecDescriptor *old_desc = NULL, *desc;
+    const AVCodec *codec;
+    void *iter = NULL;
 
     while (desc = avcodec_descriptor_next(old_desc)) {
         if (old_desc && old_desc->id >= desc->id) {
@@ -40,6 +43,13 @@  int main(int argc, char **argv)
 
         old_desc = desc;
     }
+    while (codec = av_codec_iterate(&iter)) {
+        if (!avcodec_descriptor_get(codec->id)) {
+            av_log(NULL, AV_LOG_FATAL, "Codec %s lacks a corresponding descriptor\n",
+                   codec->name);
+            return 1;
+        }
+    }
 
     return 0;
 }