From a27114bb4bc24b4d43ab31b22f680a449f3cc92e Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 4 Dec 2013 21:10:10 +0100 Subject: af: returning NULL on filtering means error This code used to be ok, until the assert() was added. Simplify the loop statement, since the other NULL check for data doesn't make sense anymore. --- audio/filter/af.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/audio/filter/af.c b/audio/filter/af.c index f4da46d141..a48780885b 100644 --- a/audio/filter/af.c +++ b/audio/filter/af.c @@ -700,11 +700,13 @@ struct mp_audio *af_play(struct af_stream *s, struct mp_audio *data) struct af_instance *af = s->first; assert(mp_audio_config_equals(af->data, data)); // Iterate through all filters - do { + while (af) { data = af->play(af, data); + if (!data) + return NULL; assert(mp_audio_config_equals(af->data, data)); af = af->next; - } while (af && data); + } return data; } -- cgit v1.2.3