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 +------------------------------------- audio/filter/af.h | 5 ----- 2 files changed, 1 insertion(+), 42 deletions(-) (limited to 'audio/filter') 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; diff --git a/audio/filter/af.h b/audio/filter/af.h index e9299c132f..cecc3897b3 100644 --- a/audio/filter/af.h +++ b/audio/filter/af.h @@ -62,11 +62,6 @@ struct af_instance { struct replaygain_data *replaygain_data; int (*control)(struct af_instance *af, int cmd, void *arg); void (*uninit)(struct af_instance *af); - /* old filter function (use filter_frame instead) - * flags is a bit mask of AF_FILTER_FLAG_* values - * returns 0 on success, negative value on error - */ - int (*filter)(struct af_instance *af, struct mp_audio *data, int flags); /* Feed a frame. The frame is NULL if EOF was reached, and the filter * should drain all remaining buffered data. * Use af_add_output_frame() to output data. The optional filter_out -- cgit v1.2.3