mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
rawparse: Don't try to retrieve 0 byte buffers from the adapter in multi-frame mode
This commit is contained in:
parent
871ec4693c
commit
ee0ccf64c5
1 changed files with 7 additions and 3 deletions
|
@ -287,7 +287,7 @@ gst_raw_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
|||
GstRawParse *rp = GST_RAW_PARSE (parent);
|
||||
GstFlowReturn ret = GST_FLOW_OK;
|
||||
GstRawParseClass *rp_class = GST_RAW_PARSE_GET_CLASS (rp);
|
||||
guint buffersize;
|
||||
guint buffersize, available;
|
||||
|
||||
if (G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DISCONT))) {
|
||||
GST_DEBUG_OBJECT (rp, "received DISCONT buffer");
|
||||
|
@ -306,8 +306,12 @@ gst_raw_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
|||
|
||||
gst_adapter_push (rp->adapter, buffer);
|
||||
|
||||
if (rp_class->multiple_frames_per_buffer) {
|
||||
buffersize = gst_adapter_available (rp->adapter);
|
||||
available = gst_adapter_available (rp->adapter);
|
||||
if (available == 0) {
|
||||
ret = GST_FLOW_OK;
|
||||
goto done;
|
||||
} else if (rp_class->multiple_frames_per_buffer) {
|
||||
buffersize = available;
|
||||
buffersize -= buffersize % rp->framesize;
|
||||
} else {
|
||||
buffersize = rp->framesize;
|
||||
|
|
Loading…
Reference in a new issue