diff options
Diffstat (limited to 'video/img_format.c')
-rw-r--r-- | video/img_format.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/video/img_format.c b/video/img_format.c index 12822b176f..131ff4cb11 100644 --- a/video/img_format.c +++ b/video/img_format.c @@ -486,6 +486,15 @@ int mp_imgfmt_select_best(int dst1, int dst2, int src) return pixfmt2imgfmt(avcodec_find_best_pix_fmt_of_list(dstlist, srcpxf, 1, 0)); } +// Same as mp_imgfmt_select_best(), but with a list of dst formats. +int mp_imgfmt_select_best_list(int *dst, int num_dst, int src) +{ + int best = 0; + for (int n = 0; n < num_dst; n++) + best = best ? mp_imgfmt_select_best(best, dst[n], src) : dst[n]; + return best; +} + #if 0 #include <libavutil/frame.h> |