From ce08823dc5bab446e07ecae0c78420751fd416d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 8 Jul 2009 15:52:35 +0200 Subject: [PATCH] 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. --- ext/gio/gstgiosrc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ext/gio/gstgiosrc.c b/ext/gio/gstgiosrc.c index f8a4a8848b..e036bc87e4 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));