mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-27 06:33:21 -05:00
Use avcodec_find_best_pix_fmt2 (avcodec_find_best_pix_fmt deprecated in libav9)
This commit is contained in:
parent
95b67668b4
commit
416b89f51a
@ -161,9 +161,6 @@ artwork_rescale(AVFormatContext *src_ctx, int s, int out_w, int out_h, int forma
|
|||||||
AVCodec *img_decoder;
|
AVCodec *img_decoder;
|
||||||
AVCodec *img_encoder;
|
AVCodec *img_encoder;
|
||||||
|
|
||||||
int64_t pix_fmt_mask;
|
|
||||||
const enum PixelFormat *pix_fmts;
|
|
||||||
|
|
||||||
AVFrame *i_frame;
|
AVFrame *i_frame;
|
||||||
AVFrame *o_frame;
|
AVFrame *o_frame;
|
||||||
|
|
||||||
@ -294,7 +291,12 @@ artwork_rescale(AVFormatContext *src_ctx, int s, int out_w, int out_h, int forma
|
|||||||
dst->codec_type = CODEC_TYPE_VIDEO;
|
dst->codec_type = CODEC_TYPE_VIDEO;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pix_fmt_mask = 0;
|
#if LIBAVCODEC_VERSION_MAJOR >= 55 || (LIBAVCODEC_VERSION_MAJOR == 54 && LIBAVCODEC_VERSION_MINOR >= 35)
|
||||||
|
dst->pix_fmt = avcodec_find_best_pix_fmt2((enum AVPixelFormat *)img_encoder->pix_fmts, src->pix_fmt, 1, NULL);
|
||||||
|
#else
|
||||||
|
const enum PixelFormat *pix_fmts;
|
||||||
|
int64_t pix_fmt_mask = 0;
|
||||||
|
|
||||||
pix_fmts = img_encoder->pix_fmts;
|
pix_fmts = img_encoder->pix_fmts;
|
||||||
while (pix_fmts && (*pix_fmts != -1))
|
while (pix_fmts && (*pix_fmts != -1))
|
||||||
{
|
{
|
||||||
@ -303,6 +305,7 @@ artwork_rescale(AVFormatContext *src_ctx, int s, int out_w, int out_h, int forma
|
|||||||
}
|
}
|
||||||
|
|
||||||
dst->pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src->pix_fmt, 1, NULL);
|
dst->pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src->pix_fmt, 1, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (dst->pix_fmt < 0)
|
if (dst->pix_fmt < 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user