summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh de Kock <josh@itanimul.li>2016-07-24 20:55:42 +0100
committerDiego Biurrun <diego@biurrun.de>2016-09-15 17:22:38 +0200
commitbc7399934def210c2a84ea51375d50f79c676c96 (patch)
treeafd10cac28797439ced9c7c3913012977f74e331
parentdf3795025337479a639cb3cd26c93a4e82ccd4db (diff)
libdc1394: Distinguish between enumeration errors and no cameras found
Signed-off-by: Diego Biurrun <diego@biurrun.de>
-rw-r--r--libavdevice/libdc1394.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c
index a0ea592c9f..c823388a76 100644
--- a/libavdevice/libdc1394.c
+++ b/libavdevice/libdc1394.c
@@ -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;
}