mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-30 09:03:23 -05:00
[artwork] Re-apply commit ef13abe
to artwork_legacy.c
This commit is contained in:
parent
e489f1a6a9
commit
a975dabded
@ -456,11 +456,7 @@ artwork_rescale(struct evbuffer *evbuf, AVFormatContext *src_ctx, int s, int out
|
|||||||
dst->codec_id = dst_fmt->video_codec;
|
dst->codec_id = dst_fmt->video_codec;
|
||||||
dst->codec_type = AVMEDIA_TYPE_VIDEO;
|
dst->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||||
|
|
||||||
if (dst_fmt->video_codec == AV_CODEC_ID_PNG)
|
dst->pix_fmt = avcodec_default_get_format(dst, img_encoder->pix_fmts);
|
||||||
dst->pix_fmt = AV_PIX_FMT_RGB24;
|
|
||||||
else
|
|
||||||
dst->pix_fmt = avcodec_find_best_pix_fmt_of_list((enum AVPixelFormat *)img_encoder->pix_fmts, src->pix_fmt, 1, NULL);
|
|
||||||
|
|
||||||
if (dst->pix_fmt < 0)
|
if (dst->pix_fmt < 0)
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_ART, "Could not determine best pixel format\n");
|
DPRINTF(E_LOG, L_ART, "Could not determine best pixel format\n");
|
||||||
@ -514,6 +510,10 @@ artwork_rescale(struct evbuffer *evbuf, AVFormatContext *src_ctx, int s, int out
|
|||||||
avpicture_fill((AVPicture *)o_frame, buf, dst->pix_fmt, src->width, src->height);
|
avpicture_fill((AVPicture *)o_frame, buf, dst->pix_fmt, src->width, src->height);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
o_frame->height = dst->height;
|
||||||
|
o_frame->width = dst->width;
|
||||||
|
o_frame->format = dst->pix_fmt;
|
||||||
|
|
||||||
swsctx = sws_getContext(src->width, src->height, src->pix_fmt,
|
swsctx = sws_getContext(src->width, src->height, src->pix_fmt,
|
||||||
dst->width, dst->height, dst->pix_fmt,
|
dst->width, dst->height, dst->pix_fmt,
|
||||||
SWS_BICUBIC, NULL, NULL, NULL);
|
SWS_BICUBIC, NULL, NULL, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user