summaryrefslogtreecommitdiffstats
path: root/filters/f_swscale.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-04-12 21:55:35 +0200
committerwm4 <wm4@nowhere>2020-04-13 15:56:27 +0200
commitc99d95ac17364c46bc161867d1102361f05a6cc5 (patch)
tree25b1033cbd19b87ec076f1c91b26677a07788772 /filters/f_swscale.c
parent28f2d7454d5ea997dec691376ebcdf4c4e0454b4 (diff)
downloadmpv-c99d95ac17364c46bc161867d1102361f05a6cc5.tar.bz2
mpv-c99d95ac17364c46bc161867d1102361f05a6cc5.tar.xz
vf_format: add gross mechanism for forcing scaler for testing
This sucks, but is helpful for testing. Obviously, it would be much nicer if there were a way to specify _all_ scaler options per filter (if the user wanted), instead of always using the global options. But this is "too hard" for now. For testing, it is extremely convenient to select the scaler backend, so add this option, but make clear that it could go away. We'd delete it once there is a better mechanism for this.
Diffstat (limited to 'filters/f_swscale.c')
-rw-r--r--filters/f_swscale.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/filters/f_swscale.c b/filters/f_swscale.c
index f9af4d18fb..614de1466c 100644
--- a/filters/f_swscale.c
+++ b/filters/f_swscale.c
@@ -43,6 +43,8 @@
int mp_sws_find_best_out_format(struct mp_sws_filter *sws, int in_format,
int *out_formats, int num_out_formats)
{
+ sws->sws->force_scaler = sws->force_scaler;
+
int best = 0;
for (int n = 0; n < num_out_formats; n++) {
int out_format = out_formats[n];
@@ -73,6 +75,8 @@ static void process(struct mp_filter *f)
if (!mp_pin_can_transfer_data(f->ppins[1], f->ppins[0]))
return;
+ s->sws->force_scaler = s->force_scaler;
+
struct mp_frame frame = mp_pin_out_read(f->ppins[0]);
if (mp_frame_is_signaling(frame)) {
mp_pin_in_write(f->ppins[1], frame);