diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-07-08 15:52:35 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-07-08 15:52:35 +0200 |
commit | ce08823dc5bab446e07ecae0c78420751fd416d7 (patch) | |
tree | d549a6b00382c56b145214c45a726b7e22d5102f | |
parent | fa0a5a667f5dd1df04970fff881df160d03b08a2 (diff) |
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.
-rw-r--r-- | ext/gio/gstgiosrc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/gio/gstgiosrc.c b/ext/gio/gstgiosrc.c index f8a4a8848..e036bc87e 100644 --- a/ext/gio/gstgiosrc.c +++ b/ext/gio/gstgiosrc.c @@ -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)); |