mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 00:01:23 +00:00
gst/gstpad.c: Do not abort on out of memory for pad_alloc_buffer.
Original commit message from CVS: * gst/gstpad.c: Do not abort on out of memory for pad_alloc_buffer.
This commit is contained in:
parent
de58154333
commit
dbbdcf5dd3
2 changed files with 14 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2008-04-10 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
|
* gst/gstpad.c:
|
||||||
|
Do not abort on out of memory for pad_alloc_buffer.
|
||||||
|
|
||||||
2008-04-10 Stefan Kost <ensonic@users.sf.net>
|
2008-04-10 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
* libs/gst/check/gstcheck.c:
|
* libs/gst/check/gstcheck.c:
|
||||||
|
|
|
@ -2699,11 +2699,15 @@ fallback:
|
||||||
/* fallback case, allocate a buffer of our own, add pad caps. */
|
/* fallback case, allocate a buffer of our own, add pad caps. */
|
||||||
GST_CAT_DEBUG_OBJECT (GST_CAT_PADS, pad, "fallback buffer alloc");
|
GST_CAT_DEBUG_OBJECT (GST_CAT_PADS, pad, "fallback buffer alloc");
|
||||||
|
|
||||||
*buf = gst_buffer_new_and_alloc (size);
|
if ((*buf = gst_buffer_try_new_and_alloc (size))) {
|
||||||
GST_BUFFER_OFFSET (*buf) = offset;
|
GST_BUFFER_OFFSET (*buf) = offset;
|
||||||
gst_buffer_set_caps (*buf, caps);
|
gst_buffer_set_caps (*buf, caps);
|
||||||
|
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
} else {
|
||||||
|
GST_CAT_DEBUG_OBJECT (GST_CAT_PADS, pad,
|
||||||
|
"out of memory allocating %d bytes", size);
|
||||||
|
return GST_FLOW_ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue