aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/tests/avcodec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-24 02:27:17 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-26 12:56:08 +0200
commit136865413c04760aeeda6079002bc3c1f9ae230a (patch)
treea6ac1d3fc8c6de7284177427374d01bcdf3e4d57 /libavcodec/tests/avcodec.c
parentf348a967a35c0946de0d9f6bedb1f4025b09b334 (diff)
downloadffmpeg-136865413c04760aeeda6079002bc3c1f9ae230a.tar.gz
avcodec/tests/utils: Rename to avcodec
The current name comes from a time in which libavcodec/utils.c contained the whole core of libavcodec. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/tests/avcodec.c')
-rw-r--r--libavcodec/tests/avcodec.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/libavcodec/tests/avcodec.c b/libavcodec/tests/avcodec.c
new file mode 100644
index 0000000000..9232647ff0
--- /dev/null
+++ b/libavcodec/tests/avcodec.c
@@ -0,0 +1,37 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavcodec/avcodec.h"
+
+int main(void){
+ void *iter = NULL;
+ const AVCodec *codec = NULL;
+ int ret = 0;
+
+ while (codec = av_codec_iterate(&iter)) {
+ 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;
+}