diff options
author | Josh de Kock <josh@itanimul.li> | 2016-07-24 19:49:40 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-07-25 19:39:13 +0200 |
commit | 384251daffb98d88b0fe897b341bb68445f885de (patch) | |
tree | 95239d713a704d3dcd79d8e58c65fb14566a0d08 /libavdevice | |
parent | e947b75b1c76ef6793209c2c445b8c224a28717a (diff) | |
download | ffmpeg-384251daffb98d88b0fe897b341bb68445f885de.tar.gz |
lavd/libdc1394: distinguish between enumeration errors and no cameras found
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavdevice')
-rw-r--r-- | libavdevice/libdc1394.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c index 43fa232922..60c6146652 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; } |