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 https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1386
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1568>
}
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);
gl_src->running_time = next_time;
+ ret = GST_FLOW_OK;
GST_OBJECT_UNLOCK (src);
return ret;
}