mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-30 09:03:23 -05:00
parent
efd6805f9e
commit
ef13abe2cf
@ -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");
|
||||||
@ -513,6 +509,9 @@ artwork_rescale(struct evbuffer *evbuf, AVFormatContext *src_ctx, int s, int out
|
|||||||
#else
|
#else
|
||||||
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,
|
||||||
|
Loading…
Reference in New Issue
Block a user