libdc1394: Distinguish between enumeration errors and no cameras found
authorJosh de Kock <josh@itanimul.li>
Sun, 24 Jul 2016 19:55:42 +0000 (20:55 +0100)
committerDiego Biurrun <diego@biurrun.de>
Thu, 15 Sep 2016 15:22:38 +0000 (17:22 +0200)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
libavdevice/libdc1394.c

index a0ea592..c823388 100644 (file)
@@ -299,9 +299,14 @@ static int dc1394_v2_read_header(AVFormatContext *c)
 
     /* Now let us prep the hardware. */
     dc1394->d = dc1394_new();
-    dc1394_camera_enumerate (dc1394->d, &list);
-    if ( !list || list->num == 0) {
-        av_log(c, AV_LOG_ERROR, "Unable to look for an IIDC camera\n\n");
+    if (dc1394_camera_enumerate(dc1394->d, &list) != DC1394_SUCCESS || !list) {
+        av_log(c, AV_LOG_ERROR, "Unable to look for an IIDC camera.\n");
+        goto out;
+    }
+
+    if (list->num == 0) {
+        av_log(c, AV_LOG_ERROR, "No cameras found.\n");
+        dc1394_camera_free_list(list);
         goto out;
     }