From ae641d200a10bb1272477af7b298bcfa9c44363b Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 15 Jan 2015 20:11:42 +0100 Subject: af: remove old filter compatibility hack --- audio/filter/af.c | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'audio/filter/af.c') diff --git a/audio/filter/af.c b/audio/filter/af.c index 37d002fc5d..dc534efa5b 100644 --- a/audio/filter/af.c +++ b/audio/filter/af.c @@ -803,43 +803,7 @@ static int af_do_filter(struct af_instance *af, struct mp_audio *frame) { if (frame) assert(mp_audio_config_equals(&af->fmt_in, frame)); - int r = 0; - if (af->filter_frame) { - r = af->filter_frame(af, frame); - frame = NULL; - } else { - // Compatibility path. - int flags = 0; - struct mp_audio input; - char dummy[MP_NUM_CHANNELS]; - if (frame) { - // We don't know if the filter will write; but it might possibly. - r = mp_audio_make_writeable(frame); - input = *frame; - // Don't give it a refcounted frame - for (int n = 0; n < MP_NUM_CHANNELS; n++) - input.allocated[n] = NULL; - } else { - input = af->fmt_in; - mp_audio_set_null_data(&input); - flags = AF_FILTER_FLAG_EOF; - for (int n = 0; n < MP_NUM_CHANNELS; n++) - input.planes[n] = &dummy[n]; - } - if (r < 0) - goto done; - r = af->filter(af, &input, flags); - if (input.samples) { - struct mp_audio *new = mp_audio_pool_new_copy(af->out_pool, &input); - if (!new) { - r = -1; - goto done; - } - af_add_output_frame(af, new); - } - } -done: - talloc_free(frame); + int r = af->filter_frame(af, frame); if (r < 0) MP_ERR(af, "Error filtering frame.\n"); return r; -- cgit v1.2.3