diff options
author | Zhao Zhili <zhilizhao@tencent.com> | 2019-12-30 21:54:18 +0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-31 12:37:47 +0100 |
commit | f78dc6608933d27b51a3d629327b6b9b982013f5 (patch) | |
tree | 25256adc41bee2d09a46e4af45a11a7b5f1afffd | |
parent | 1e3e547a5b38d56d1b054078316ff862c7bcbac9 (diff) | |
download | ffmpeg-f78dc6608933d27b51a3d629327b6b9b982013f5.tar.gz |
avcodec/utils: remove access of AV_SAMPLE_FMT_NB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 8a49234bcd..c935e07538 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1510,7 +1510,7 @@ int av_get_exact_bits_per_sample(enum AVCodecID codec_id) enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be) { - static const enum AVCodecID map[AV_SAMPLE_FMT_NB][2] = { + static const enum AVCodecID map[][2] = { [AV_SAMPLE_FMT_U8 ] = { AV_CODEC_ID_PCM_U8, AV_CODEC_ID_PCM_U8 }, [AV_SAMPLE_FMT_S16 ] = { AV_CODEC_ID_PCM_S16LE, AV_CODEC_ID_PCM_S16BE }, [AV_SAMPLE_FMT_S32 ] = { AV_CODEC_ID_PCM_S32LE, AV_CODEC_ID_PCM_S32BE }, @@ -1523,7 +1523,7 @@ enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be) [AV_SAMPLE_FMT_FLTP] = { AV_CODEC_ID_PCM_F32LE, AV_CODEC_ID_PCM_F32BE }, [AV_SAMPLE_FMT_DBLP] = { AV_CODEC_ID_PCM_F64LE, AV_CODEC_ID_PCM_F64BE }, }; - if (fmt < 0 || fmt >= AV_SAMPLE_FMT_NB) + if (fmt < 0 || fmt >= FF_ARRAY_ELEMS(map)) return AV_CODEC_ID_NONE; if (be < 0 || be > 1) be = AV_NE(1, 0); |