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
This commit is contained in:
Thomas Vander Stichele 2006-04-05 12:41:14 +00:00
parent 227563fe37
commit 490f1c0132
2 changed files with 26 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2006-04-05 Thomas Vander Stichele <thomas at apestaart dot org>
* ext/raw1394/gstdv1394src.c:
distinguish between device not found and could not open for
reading
2006-04-03 Thomas Vander Stichele <thomas at apestaart dot org>
* Makefile.am:

View file

@ -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: