diff options
author | David Schleef <ds@schleef.org> | 2013-04-01 20:03:59 -0700 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2013-04-01 20:03:59 -0700 |
commit | ed822e19de772b33b801526a861dbadaba47f648 (patch) | |
tree | 90863a0d56bc2b6dc6283046bc17a848efe346a8 | |
parent | d63458b7defc8d784a4c2bcdb5def8edffe68696 (diff) | |
download | gstreamer-plugins-bad-ed822e19de772b33b801526a861dbadaba47f648.tar.gz |
interaudiosink: fix leak when not connected
-rw-r--r-- | gst/inter/gstinteraudiosink.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gst/inter/gstinteraudiosink.c b/gst/inter/gstinteraudiosink.c index 21ad8432a..04720d0a5 100644 --- a/gst/inter/gstinteraudiosink.c +++ b/gst/inter/gstinteraudiosink.c @@ -335,9 +335,10 @@ gst_inter_audio_sink_render (GstBaseSink * sink, GstBuffer * buffer) n = gst_adapter_available (interaudiosink->surface->audio_adapter) / 4; #define SIZE 1600 if (n > (1600 * 3)) { - GST_WARNING ("flushing 800 samples"); - gst_adapter_flush (interaudiosink->surface->audio_adapter, (SIZE / 2) * 4); - n -= (SIZE / 2); + int n_chunks = (n / (SIZE / 2)) - 4; + GST_WARNING ("flushing %d samples", n_chunks * 800); + gst_adapter_flush (interaudiosink->surface->audio_adapter, + n_chunks * (SIZE / 2) * 4); } gst_adapter_push (interaudiosink->surface->audio_adapter, gst_buffer_ref (buffer)); |