summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-04 21:10:10 +0100
committerwm4 <wm4@nowhere>2013-12-04 23:12:51 +0100
commita27114bb4bc24b4d43ab31b22f680a449f3cc92e (patch)
treed056cbeae4bd957d8d7e3166299eccc19c116404 /audio
parent59aed93208398e42829ea17e0639f0a3588bdf65 (diff)
downloadmpv-a27114bb4bc24b4d43ab31b22f680a449f3cc92e.tar.bz2
mpv-a27114bb4bc24b4d43ab31b22f680a449f3cc92e.tar.xz
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.
Diffstat (limited to 'audio')
-rw-r--r--audio/filter/af.c6
1 files 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;
}