From 3d4071e6e5b4a536391cd8cfe54ddf2e2f7f915d Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 3 Feb 2018 13:13:49 +0100 Subject: [PATCH] swresample: remove unnecessary request for new input We called mp_pin_out_request_data() if there was input _and_ output. This is not how it should be: we should request new input only if output was requested, but we could not produce any output. On the other hand, the upper half of the process() function will request new input if output is required, but all input was consumed. But this requires calling mp_filter_internal_mark_progress(), as otherwise the general filter logic would not know that we can continue. --- filters/f_swresample.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/filters/f_swresample.c b/filters/f_swresample.c index 39efe173bf..2bb1e4cd02 100644 --- a/filters/f_swresample.c +++ b/filters/f_swresample.c @@ -668,12 +668,13 @@ static void process(struct mp_filter *f) if (p->input && out.type) { mp_pin_in_write(f->ppins[1], out); - mp_pin_out_request_data(f->ppins[0]); } else if (!p->input && out.type) { mp_pin_in_write(f->ppins[1], out); mp_pin_out_repeat_eof(f->ppins[0]); } else if (!p->input) { mp_pin_in_write(f->ppins[1], MP_EOF_FRAME); + } else { + mp_filter_internal_mark_progress(f); // try to consume more input } if (p->input && !mp_aframe_get_size(p->input))