avcodec/imgconvert: Fix loss mask bug in avcodec_find_best_pix_fmt_of_list()
authorheimdallr <heimdallr@ngs.ru>
Sat, 31 Mar 2018 12:37:23 +0000 (19:37 +0700)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 9 Jul 2018 23:18:52 +0000 (01:18 +0200)
commiteb8654610927dc3dcacf777b0a8bd52ce6c02431
tree290b5602a0d39d83b6f4d0932082558ba91e9bc7
parent367d459f78c1cecce1d1a8e5bbe6a8b908de3e2f
avcodec/imgconvert: Fix loss mask bug in avcodec_find_best_pix_fmt_of_list()

example:

AVPixelFormat pixFmts[] = { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA };
int loss = 0;
AVPixelFormat best = avcodec_find_best_pix_fmt_of_list(pixFmts, AV_PIX_FMT_BGRA, 1, &loss);

best is AV_PIX_FMT_RGB24. But AV_PIX_FMT_RGBA is better.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 354b26a3945eadd4ed8fcd801dfefad2566241de)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/imgconvert.c