From 1dd83ca6ee76834a18fc6152493ace44a0fd8bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Oct 2014 15:07:04 +0200 Subject: [PATCH] rawparse: Check for 0-size after adjusting the size for the frame size If we don't have a complete raw audio frame we would otherwise still ask for a 0 sized buffer from the adapter. --- gst/rawparse/gstrawparse.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gst/rawparse/gstrawparse.c b/gst/rawparse/gstrawparse.c index 198bed52b1..5831293ce1 100644 --- a/gst/rawparse/gstrawparse.c +++ b/gst/rawparse/gstrawparse.c @@ -307,17 +307,14 @@ gst_raw_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) gst_adapter_push (rp->adapter, buffer); available = gst_adapter_available (rp->adapter); - if (available == 0) { - ret = GST_FLOW_OK; - goto done; - } else if (rp_class->multiple_frames_per_buffer) { + if (rp_class->multiple_frames_per_buffer) { buffersize = available; buffersize -= buffersize % rp->framesize; } else { buffersize = rp->framesize; } - while (gst_adapter_available (rp->adapter) >= buffersize) { + while (buffersize > 0 && gst_adapter_available (rp->adapter) >= buffersize) { buffer = gst_adapter_take_buffer (rp->adapter, buffersize); ret = gst_raw_parse_push_buffer (rp, buffer);