Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-24 03:34:50 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-26 14:29:01 +0300
commitd77798309fa9527cce3e5811e9cdd85214335846 (patch)
treed2311094892f4c70e34581158ed1bb8c8d1ce7b2 /libavcodec/tests
parent0d97317429520b97d5817d713d6ffe7de78d0068 (diff)
avcodec/tests/avcodec: Test AVCodec and AVCodecDescriptor consistency
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/tests')
-rw-r--r--libavcodec/tests/avcodec.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libavcodec/tests/avcodec.c b/libavcodec/tests/avcodec.c
index 2b8a9a5d0f..24372cfa1f 100644
--- a/libavcodec/tests/avcodec.c
+++ b/libavcodec/tests/avcodec.c
@@ -16,7 +16,8 @@
* 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"
static const char *get_type_string(enum AVMediaType type)
{
@@ -39,6 +40,8 @@ int main(void){
int ret = 0;
while (codec = av_codec_iterate(&iter)) {
+ const AVCodecDescriptor *desc;
+
if (!codec->name) {
AV_LOG("Codec for format %s has no name\n",
avcodec_get_name(codec->id));
@@ -68,6 +71,12 @@ int main(void){
}
}
}
+ if (!(desc = avcodec_descriptor_get(codec->id))) {
+ ERR("Codec %s lacks a corresponding descriptor\n");
+ } else if (desc->type != codec->type)
+ ERR_EXT("The type of AVCodec %s and its AVCodecDescriptor differ: "
+ "%s vs %s\n",
+ get_type_string(codec->type), get_type_string(desc->type));
}
return ret;
}