aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2015-01-15 20:11:42 +0100
committerGravatar wm4 <wm4@nowhere>2015-01-15 20:13:15 +0100
commitae641d200a10bb1272477af7b298bcfa9c44363b (patch)
treecdf39bbdcaf5af0b9fd73d8651aa619a0cacc736
parent388cf6dc9666be6c5a66332326180ef669171ad0 (diff)
af: remove old filter compatibility hack
-rw-r--r--audio/filter/af.c38
-rw-r--r--audio/filter/af.h5
2 files changed, 1 insertions, 42 deletions
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