[FFmpeg-cvslog] lavd/libdc1394: distinguish between enumeration errors and no cameras found

Josh de Kock git at videolan.org
Mon Jul 25 20:42:38 EEST 2016


ffmpeg | branch: master | Josh de Kock <josh at itanimul.li> | Sun Jul 24 19:49:40 2016 +0100| [384251daffb98d88b0fe897b341bb68445f885de] | committer: Michael Niedermayer

lavd/libdc1394: distinguish between enumeration errors and no cameras found

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=384251daffb98d88b0fe897b341bb68445f885de
---

 libavdevice/libdc1394.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c
index 43fa232..60c6146 100644
--- a/libavdevice/libdc1394.c
+++ b/libavdevice/libdc1394.c
@@ -302,9 +302,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;
     }
 



More information about the ffmpeg-cvslog mailing list