gio: Post a custom "not-mounted" message on the bus

This allows applications to mount the GFile if possible and restart
the pipeline instead of simply giving an error.
This commit is contained in:
Sebastian Dröge 2009-07-08 15:52:35 +02:00
parent fa0a5a667f
commit ce08823dc5

View file

@ -298,6 +298,14 @@ gst_gio_src_get_stream (GstGioBaseSrc * bsrc)
if (GST_GIO_ERROR_MATCHES (err, NOT_FOUND)) {
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL),
("Could not open location %s for reading: %s", uri, err->message));
} else if (GST_GIO_ERROR_MATCHES (err, NOT_MOUNTED)) {
gst_element_post_message (GST_ELEMENT_CAST (src),
gst_message_new_element (GST_OBJECT_CAST (src),
gst_structure_new ("not-mounted", "file", G_TYPE_FILE, src->file,
"uri", G_TYPE_STRING, uri, NULL)));
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL),
("Location %s not mounted: %s", uri, err->message));
} else {
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL),
("Could not open location %s for reading: %s", uri, err->message));