summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-12 09:47:01 +0100
committerwm4 <wm4@nowhere>2015-02-12 09:47:01 +0100
commit371e5d066585015b7297d9677eb9e119f3191690 (patch)
tree3128a2ba2ac7210bd1936c61e96fb54fb715e37b /audio
parent2dc49ea866471d9fb90c5f2276c2c40bcf2473ac (diff)
downloadmpv-371e5d066585015b7297d9677eb9e119f3191690.tar.bz2
mpv-371e5d066585015b7297d9677eb9e119f3191690.tar.xz
af_rubberband: fix filter error deadlock
rubberband_available() can return a negative value, which we assigned to a size_t variable, leading to the frame allocation to fail. This could spam "Error filtering frame.". (That it spams this instead of exiting should probably also be considered a bug.) At least in the realtime mode and in our case, a negative return value should not have any different meaning from a 0 return value, in particular because we call rubberband_get_samples_required() or set the "final" parameter for rubberband_process() to continue/stop processing.
Diffstat (limited to 'audio')
-rw-r--r--audio/filter/af_rubberband.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/filter/af_rubberband.c b/audio/filter/af_rubberband.c
index b2080ae59f..83019f7597 100644
--- a/audio/filter/af_rubberband.c
+++ b/audio/filter/af_rubberband.c
@@ -137,8 +137,8 @@ static int filter_out(struct af_instance *af)
mp_audio_skip_samples(p->pending, in_samples);
}
- size_t out_samples = rubberband_available(p->rubber);
- if (out_samples) {
+ int out_samples = rubberband_available(p->rubber);
+ if (out_samples > 0) {
struct mp_audio *out =
mp_audio_pool_get(af->out_pool, af->data, out_samples);
if (!out)