Add preprocessor macro FFMPEG_INCOMPATIBLE_API and use it, so

we use avcodec_find_best_pix_fmt_of_list for ffmpeg. Also rearrange
ffmpeg/libav libraries according to ffmpeg FAQ.
This commit is contained in:
ejurgensen
2014-01-12 22:34:57 +01:00
parent 60f43c94c9
commit 3f33f33310
2 changed files with 10 additions and 3 deletions

View File

@@ -293,7 +293,11 @@ artwork_rescale(AVFormatContext *src_ctx, int s, int out_w, int out_h, int forma
#endif
#if LIBAVCODEC_VERSION_MAJOR >= 55 || (LIBAVCODEC_VERSION_MAJOR == 54 && LIBAVCODEC_VERSION_MINOR >= 35)
# ifndef FFMPEG_INCOMPATIBLE_API
dst->pix_fmt = avcodec_find_best_pix_fmt2((enum AVPixelFormat *)img_encoder->pix_fmts, src->pix_fmt, 1, NULL);
# else
dst->pix_fmt = avcodec_find_best_pix_fmt_of_list((enum AVPixelFormat *)img_encoder->pix_fmts, src->pix_fmt, 1, NULL);
# endif
#else
const enum PixelFormat *pix_fmts;
int64_t pix_fmt_mask = 0;