dc1394src: Remove logically dead code
authorEdward Hervey <edward@centricular.com>
Fri, 24 Nov 2017 06:57:49 +0000 (07:57 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 24 Nov 2017 06:57:49 +0000 (07:57 +0100)
buffer would always be NULL in the error case. Simplify and just
return GST_FLOW_ERROR

CID #1417216

ext/dc1394/gstdc1394src.c

index 0c92f92..123e9d9 100644 (file)
@@ -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;
 }