diff options
author | Muhammad Faiz <mfcc64@gmail.com> | 2018-02-10 12:30:14 +0300 |
---|---|---|
committer | Muhammad Faiz <mfcc64@gmail.com> | 2018-02-12 02:06:37 +0300 |
commit | b7d476b1384fe0e4a2c4d424d880d9c4f0b6f7ca (patch) | |
tree | 52525cc2af973b3c14e6c8e78d69a85a7d3dade8 /libavcodec/codec_desc.c | |
parent | dced1f6cdfe479965898bed3cb5219d2ddbb0ad9 (diff) |
fate/libavcodec: add codec_desc test
Remove runtime check at codec_desc.c
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
Diffstat (limited to 'libavcodec/codec_desc.c')
-rw-r--r-- | libavcodec/codec_desc.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index 15f6489278..44a54a31c9 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -21,10 +21,8 @@ #include <string.h> -#include "libavutil/avassert.h" #include "libavutil/common.h" #include "libavutil/internal.h" -#include "libavutil/thread.h" #include "avcodec.h" #include "profiles.h" #include "version.h" @@ -3111,26 +3109,6 @@ static const AVCodecDescriptor codec_descriptors[] = { }, }; -#if defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 -static void check_validity(void) -{ - int i; - - for (i = 0; i < FF_ARRAY_ELEMS(codec_descriptors) - 1; i++) { - if (codec_descriptors[i].id >= codec_descriptors[i+1].id) { - av_log(NULL, AV_LOG_FATAL, "unsorted codec_id '%s' and '%s'.\n", - codec_descriptors[i].name, codec_descriptors[i+1].name); - av_assert0(0); - } - } -} - -static AVOnce check_validity_once = AV_ONCE_INIT; -#define CHECK_VALIDITY() ff_thread_once(&check_validity_once, check_validity); -#else -#define CHECK_VALIDITY() ((void)0) -#endif - static int descriptor_compare(const void *key, const void *member) { enum AVCodecID id = *(const enum AVCodecID *) key; @@ -3141,8 +3119,6 @@ static int descriptor_compare(const void *key, const void *member) const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id) { - CHECK_VALIDITY(); - return bsearch(&id, codec_descriptors, FF_ARRAY_ELEMS(codec_descriptors), sizeof(codec_descriptors[0]), descriptor_compare); } |