From f76f060f725dc100eae252626b5557fea12b8b36 Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Thu, 16 Mar 2017 18:39:55 +0000 Subject: [PATCH] libav: Fix codecpar version check FFmpeg 3.0, as used on Ubuntu Yakkety, did not include the codecpar changes, although it uses the same library major version. So refine the libavformat version check to sort that out. --- libav.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libav.h b/libav.h index f04bb42..e706240 100644 --- a/libav.h +++ b/libav.h @@ -57,6 +57,8 @@ #include #endif +#define USE_CODECPAR LIBAVFORMAT_VERSION_INT >= ((57<<16)+(50<<8)+100) + #ifndef FF_PROFILE_H264_BASELINE #define FF_PROFILE_H264_BASELINE 66 #endif @@ -166,7 +168,7 @@ lav_get_interlaced(AVStream *s) #endif } -#if LIBAVCODEC_VERSION_MAJOR >= 57 +#if USE_CODECPAR #define lav_codec_id(s) s->codecpar->codec_id #define lav_codec_type(s) s->codecpar->codec_type #define lav_codec_tag(s) s->codecpar->codec_tag @@ -195,7 +197,7 @@ lav_get_interlaced(AVStream *s) static inline uint8_t * lav_codec_extradata(AVStream *s) { -#if LIBAVCODEC_VERSION_MAJOR >= 57 +#if USE_CODECPAR if (!s->codecpar->extradata_size) return NULL; return s->codecpar->extradata;