mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
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:
parent
ee0ccf64c5
commit
1dd83ca6ee
1 changed files with 2 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue