mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-13 02:45:35 +00:00
appsrc: handle a sample not having caps or a buffer more gracefully
https://bugzilla.gnome.org/show_bug.cgi?id=746908
This commit is contained in:
parent
b7facbaf22
commit
f23736d52f
1 changed files with 13 additions and 1 deletions
|
@ -1666,10 +1666,22 @@ gst_app_src_push_sample_internal (GstAppSrc * appsrc, GstSample * sample)
|
|||
{
|
||||
GstBuffer *buffer;
|
||||
GstCaps *caps;
|
||||
|
||||
g_return_val_if_fail (GST_IS_SAMPLE (sample), GST_FLOW_ERROR);
|
||||
|
||||
caps = gst_sample_get_caps (sample);
|
||||
gst_app_src_set_caps (appsrc, caps);
|
||||
if (caps != NULL) {
|
||||
gst_app_src_set_caps (appsrc, caps);
|
||||
} else {
|
||||
GST_WARNING_OBJECT (appsrc, "received sample without caps");
|
||||
}
|
||||
|
||||
buffer = gst_sample_get_buffer (sample);
|
||||
if (buffer == NULL) {
|
||||
GST_WARNING_OBJECT (appsrc, "received sample without buffer");
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
||||
return gst_app_src_push_buffer_full (appsrc, buffer, FALSE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue