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.
This commit is contained in:
Sebastian Dröge 2014-10-22 15:07:04 +02:00
parent ee0ccf64c5
commit 1dd83ca6ee

View file

@ -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);