Skip to content
Snippets Groups Projects
Commit 9bac0b6a authored by Jan Schmidt's avatar Jan Schmidt Committed by Tim-Philipp Müller
Browse files

wpesrc: Don't crash if WPE doesn't generate a buffer.

On creating a 2nd wpesrc in a new pipeline in an app that already
has a runnig wpesrc, WPE sometimes doesn't return a buffer on request,
leading to a crash. This commit fixes the crash, but not the underlying
failure - a 2nd wpesrc can still error out instead.

Partially fixes gstreamer/gst-plugins-bad#1386

Part-of: <gstreamer/gst-plugins-bad!1568>
parent 3ce8dec4
No related branches found
No related tags found
No related merge requests found
......@@ -169,11 +169,13 @@ gst_wpe_src_create (GstBaseSrc * bsrc, guint64 offset, guint length, GstBuffer *
}
locked_buffer = src->view->buffer ();
if (locked_buffer != NULL) {
*buf = gst_buffer_copy_deep (locked_buffer);
ret = GST_FLOW_OK;
if (locked_buffer == NULL) {
GST_OBJECT_UNLOCK (src);
GST_ELEMENT_ERROR (src, RESOURCE, FAILED,
("WPE View did not render a buffer"), (NULL));
return ret;
}
*buf = gst_buffer_copy_deep (locked_buffer);
g_object_get(gl_src, "timestamp-offset", &ts_offset, NULL);
......@@ -195,6 +197,7 @@ gst_wpe_src_create (GstBaseSrc * bsrc, guint64 offset, guint length, GstBuffer *
gl_src->running_time = next_time;
ret = GST_FLOW_OK;
GST_OBJECT_UNLOCK (src);
return ret;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment