qcamsrc: cleanup on stop_requested

Otherwise false errors and seg faults occur
This commit is contained in:
Joshua M. Doe 2021-01-19 17:07:04 -05:00
parent 44fe9a9714
commit 3bec8a37da

View File

@ -446,8 +446,10 @@ static void
video_frame_release (void *data)
{
VideoFrame *frame = (VideoFrame *) data;
if (!frame->src->stop_requested && frame->src->handle) {
video_frame_queue (frame);
}
}
static VideoFrame *
video_frame_create (GstQcamSrc * src, gsize buf_size)
@ -681,9 +683,13 @@ gst_qcamsrc_create (GstPushSrc * psrc, GstBuffer ** buf)
(VideoFrame *) g_async_queue_timeout_pop (src->queue,
(guint64) src->timeout * 1000 + src->exposure);
if (!video_frame) {
if (!src->stop_requested) {
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
("Failed to get buffer in %d ms", src->timeout), (NULL));
return GST_FLOW_ERROR;
} else {
return GST_FLOW_FLUSHING;
}
}
*buf = gst_buffer_new_wrapped_full ((GstMemoryFlags)