From c3f2b1db5d369d7764176b85a9c82d7d58774a82 Mon Sep 17 00:00:00 2001 From: "Joshua M. Doe" Date: Fri, 30 Nov 2012 09:04:30 -0500 Subject: [PATCH] niimaq: return with flow error if acquisition fails to start --- sys/niimaq/gstniimaq.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/niimaq/gstniimaq.c b/sys/niimaq/gstniimaq.c index 2ce810a..6141f58 100644 --- a/sys/niimaq/gstniimaq.c +++ b/sys/niimaq/gstniimaq.c @@ -699,10 +699,6 @@ gst_niimaqsrc_start_acquisition (GstNiImaqSrc * niimaqsrc) } /* we tried five times and failed, so we error */ - GST_ELEMENT_ERROR (niimaqsrc, RESOURCE, FAILED, - ("Camera doesn't seem to want to turn on!"), - ("Camera doesn't seem to want to turn on!")); - gst_niimaqsrc_close_interface (niimaqsrc); return FALSE; @@ -749,7 +745,11 @@ gst_niimaqsrc_create (GstPushSrc * psrc, GstBuffer ** buffer) /* start the IMAQ acquisition session if we haven't done so yet */ if (!niimaqsrc->session_started) { - gst_niimaqsrc_start_acquisition (niimaqsrc); + if (!gst_niimaqsrc_start_acquisition (niimaqsrc)) { + GST_ELEMENT_ERROR (niimaqsrc, RESOURCE, FAILED, + ("Unable to start acquisition."), (NULL)); + return GST_FLOW_ERROR; + } } if (no_copy) {