summaryrefslogtreecommitdiffstats
path: root/filters/f_swscale.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-02 17:50:24 +0100
committerwm4 <wm4@nowhere>2019-11-02 17:50:32 +0100
commite58e650a97a3938baeb7d8bb62cdae04ac6b6fb1 (patch)
treece727274a33c6b0a77d1eece716565075e354247 /filters/f_swscale.c
parent3e660f6164005d3a532abd76f5e7049c5c4323f9 (diff)
downloadmpv-e58e650a97a3938baeb7d8bb62cdae04ac6b6fb1.tar.bz2
mpv-e58e650a97a3938baeb7d8bb62cdae04ac6b6fb1.tar.xz
video: mess with the filte chain to enable zimg IMGFMT_RGB30 output
This was too hardcoded to libswscale. In particular, IMGFMT_RGB30 output is only possible with the zimg wrapper, so the context needs to be taken into account (since this depends on the --sws-allow-zimg option dynamically). This is still slightly risky, because zimg currently will still fall back to swscale in some cases, such as when it refuses to initialize the particular color conversion that is requested. f_autoconvert.c could actually handle this better, but I'm tool fucking lazy right now, and nobody cares anyway, so go away, OK?
Diffstat (limited to 'filters/f_swscale.c')
-rw-r--r--filters/f_swscale.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/filters/f_swscale.c b/filters/f_swscale.c
index 6b4b5842ac..f9af4d18fb 100644
--- a/filters/f_swscale.c
+++ b/filters/f_swscale.c
@@ -40,17 +40,14 @@
#include "filter.h"
#include "filter_internal.h"
-int mp_sws_find_best_out_format(int in_format, int *out_formats,
- int num_out_formats)
+int mp_sws_find_best_out_format(struct mp_sws_filter *sws, int in_format,
+ int *out_formats, int num_out_formats)
{
- if (sws_isSupportedInput(imgfmt2pixfmt(in_format)) < 1)
- return 0;
-
int best = 0;
for (int n = 0; n < num_out_formats; n++) {
int out_format = out_formats[n];
- if (sws_isSupportedOutput(imgfmt2pixfmt(out_format)) < 1)
+ if (!mp_sws_supports_formats(sws->sws, out_format, in_format))
continue;
if (best) {