[artwork] Hardcode destination pixel format for png rescaling since
avcode_find_best_pix_fmt_of_list() does not live up to its name (fixes issue #345)
This commit is contained in:
parent
084de7811e
commit
db4068f046
|
@ -457,7 +457,11 @@ artwork_rescale(struct evbuffer *evbuf, AVFormatContext *src_ctx, int s, int out
|
|||
dst->codec_id = dst_fmt->video_codec;
|
||||
dst->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
|
||||
dst->pix_fmt = avcodec_find_best_pix_fmt_of_list((enum AVPixelFormat *)img_encoder->pix_fmts, src->pix_fmt, 1, NULL);
|
||||
if (dst_fmt->video_codec == AV_CODEC_ID_PNG)
|
||||
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)
|
||||
{
|
||||
DPRINTF(E_LOG, L_ART, "Could not determine best pixel format\n");
|
||||
|
|
Loading…
Reference in New Issue