aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-02-28 12:35:33 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-02-29 21:44:06 +0100
commit0be09f54fb2a8f9070f29918754280154fbbc34d (patch)
tree3ce0b2dc2f9cd20045ca0869fc3fad65829f2668
parent9f9ed79d4cb40e5d9093899f8a79086ff23da844 (diff)
downloadffmpeg-0be09f54fb2a8f9070f29918754280154fbbc34d.tar.gz
avcodec: Add utils test
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/Makefile1
-rw-r--r--libavcodec/utils.c20
2 files changed, 21 insertions, 0 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 5389725d9f..667e2578d0 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -952,6 +952,7 @@ TESTPROGS = imgconvert \
jpeg2000dwt \
mathops \
options \
+ utils \
avfft \
TESTPROGS-$(CONFIG_CABAC) += cabac
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index b1ba51e797..f4355884ca 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -3679,3 +3679,23 @@ AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx)
return props;
}
+
+#ifdef TEST
+int main(void){
+ avcodec_register_all();
+ AVCodec *codec = NULL;
+ int ret = 0;
+
+ while (codec = av_codec_next(codec)) {
+ if (av_codec_is_encoder(codec)) {
+ if (codec->type == AVMEDIA_TYPE_AUDIO) {
+ if (!codec->sample_fmts) {
+ av_log(NULL, AV_LOG_FATAL, "Encoder %s is missing the sample_fmts field\n", codec->name);
+ ret = 1;
+ }
+ }
+ }
+ }
+ return ret;
+}
+#endif /* TEST */