diff --git a/libavcodec/codec2utils.h b/libavcodec/codec2utils.h index e9b1f84d84..2ee7a592a1 100644 --- a/libavcodec/codec2utils.h +++ b/libavcodec/codec2utils.h @@ -70,11 +70,6 @@ static inline void codec2_make_extradata(uint8_t *ptr, int mode) { ptr[3] = 0; //flags } -//Returns version as a 16-bit value. 0.8 -> 0x0008 -static inline uint16_t codec2_version_from_extradata(uint8_t *ptr) { - return (ptr[0] << 8) + ptr[1]; -} - static inline uint8_t codec2_mode_from_extradata(uint8_t *ptr) { return ptr[2]; } diff --git a/libavformat/codec2.c b/libavformat/codec2.c index 1f7f16a106..bf2fb4aa43 100644 --- a/libavformat/codec2.c +++ b/libavformat/codec2.c @@ -110,7 +110,7 @@ static int codec2_read_header(AVFormatContext *s) return ret; } - version = codec2_version_from_extradata(st->codecpar->extradata); + version = AV_RB16(st->codecpar->extradata); if ((version >> 8) != EXPECTED_CODEC2_MAJOR_VERSION) { avpriv_report_missing_feature(s, "Major version %i", version >> 8); return AVERROR_PATCHWELCOME;