diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2006-04-05 12:41:14 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2006-04-05 12:41:14 +0000 |
commit | 490f1c0132a02d0db547e7e19d913c517f8a9470 (patch) | |
tree | 7bac0159d8baf878f5f4a2679677ab994a04ec5d /ext/raw1394 | |
parent | 227563fe3782529993b2d162f79d99377bfeecde (diff) |
ext/raw1394/gstdv1394src.c: distinguish between device not found and could not open for reading
Original commit message from CVS:
* ext/raw1394/gstdv1394src.c:
distinguish between device not found and could not open for
reading
Diffstat (limited to 'ext/raw1394')
-rw-r--r-- | ext/raw1394/gstdv1394src.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/ext/raw1394/gstdv1394src.c b/ext/raw1394/gstdv1394src.c index 4e1e2e58..d3942d6c 100644 --- a/ext/raw1394/gstdv1394src.c +++ b/ext/raw1394/gstdv1394src.c @@ -667,8 +667,14 @@ gst_dv1394src_start (GstBaseSrc * bsrc) src->handle = raw1394_new_handle (); - if (!src->handle) - goto no_handle; + if (!src->handle) { + if (errno == EACCES) + goto permission_denied; + else if (errno == ENOENT) + goto not_found; + else + goto no_handle; + } raw1394_set_userdata (src->handle, src); @@ -708,10 +714,20 @@ socket_pair: GST_ERROR_SYSTEM); return FALSE; } +permission_denied: + { + GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL), GST_ERROR_SYSTEM); + return FALSE; + } +not_found: + { + GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL), GST_ERROR_SYSTEM); + return FALSE; + } no_handle: { - GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL), - ("can't get raw1394 handle")); + GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL), + ("can't get raw1394 handle (%s)", g_strerror (errno))); return FALSE; } no_ports: |