summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2017-11-24 07:57:49 +0100
committerEdward Hervey <bilboed@bilboed.com>2017-12-01 10:52:42 +0100
commit9dd7ae8b784e91e02020b568d08a2c2ddd6150f9 (patch)
tree3cf13263bfbfff37735212aac06a9a8d2eebb8cb
parentbe1b64e06efc0bc632768ab1ef8b36a6f6e82f56 (diff)
downloadgstreamer-plugins-bad-9dd7ae8b784e91e02020b568d08a2c2ddd6150f9.tar.gz
dc1394src: Remove logically dead code
buffer would always be NULL in the error case. Simplify and just return GST_FLOW_ERROR CID #1417216
-rw-r--r--ext/dc1394/gstdc1394src.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/ext/dc1394/gstdc1394src.c b/ext/dc1394/gstdc1394src.c
index 0c92f9231..123e9d9c9 100644
--- a/ext/dc1394/gstdc1394src.c
+++ b/ext/dc1394/gstdc1394src.c
@@ -317,18 +317,17 @@ static GstFlowReturn
gst_dc1394_src_create (GstPushSrc * psrc, GstBuffer ** obuf)
{
GstDC1394Src *src;
- GstBuffer *buffer;
+ GstBuffer *buffer = NULL;
dc1394video_frame_t *frame;
dc1394error_t ret;
src = GST_DC1394_SRC (psrc);
- buffer = NULL;
ret = dc1394_capture_dequeue (src->camera, DC1394_CAPTURE_POLICY_WAIT,
&frame);
if (ret != DC1394_SUCCESS) {
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
("Could not dequeue frame: %s.", dc1394_error_get_string (ret)));
- goto error;
+ return GST_FLOW_ERROR;
}
/*
* TODO: We could create the buffer by wrapping the image bytes in the frame
@@ -351,11 +350,6 @@ gst_dc1394_src_create (GstPushSrc * psrc, GstBuffer ** obuf)
}
*obuf = buffer;
return GST_FLOW_OK;
-
-error:
- if (buffer)
- gst_buffer_unref (buffer);
- return GST_FLOW_ERROR;
}