diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index e9178843b6..0035dc6e1c 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -34,6 +34,7 @@ #include "libavutil/internal.h" #include "libavutil/imgutils.h" +#if FF_API_GETCHROMA void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); @@ -41,6 +42,7 @@ void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *h_shift = desc->log2_chroma_w; *v_shift = desc->log2_chroma_h; } +#endif int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt, diff --git a/libavcodec/version.h b/libavcodec/version.h index 2dc83ba87c..61b3c545ca 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -60,6 +60,8 @@ #endif #ifndef FF_API_AVCODEC_RESAMPLE #define FF_API_AVCODEC_RESAMPLE FF_API_AUDIO_CONVERT +#ifndef FF_API_GETCHROMA +#define FF_API_GETCHROMA (LIBAVCODEC_VERSION_MAJOR < 58) #endif #ifndef FF_API_MISSING_SAMPLE #define FF_API_MISSING_SAMPLE (LIBAVCODEC_VERSION_MAJOR < 58)