summaryrefslogtreecommitdiff
path: root/sys/dvb
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2011-11-13 23:55:56 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2011-11-13 23:55:56 +0000
commit357d7bdfed98d7ee7f8e63a94b2359a8bf517e13 (patch)
treebe8240279a2f1e09b92281c3c5e82de824245f75 /sys/dvb
parent7b80e0773fb6759e8d71a535bb3c6c14106c8e66 (diff)
downloadgstreamer-plugins-bad-357d7bdfed98d7ee7f8e63a94b2359a8bf517e13.tar.gz
Update for GstURIHandler get_protocols() changes
Diffstat (limited to 'sys/dvb')
-rw-r--r--sys/dvb/dvbbasebin.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/sys/dvb/dvbbasebin.c b/sys/dvb/dvbbasebin.c
index 4cc015cec..c0b7dd78d 100644
--- a/sys/dvb/dvbbasebin.c
+++ b/sys/dvb/dvbbasebin.c
@@ -958,45 +958,53 @@ dvb_base_bin_uri_get_type (GType type)
return GST_URI_SRC;
}
-static gchar **
+static const gchar *const *
dvb_base_bin_uri_get_protocols (GType type)
{
- static gchar *protocols[] = { (char *) "dvb", NULL };
+ static const gchar *protocols[] = { "dvb", NULL };
return protocols;
}
-static const gchar *
+static gchar *
dvb_base_bin_uri_get_uri (GstURIHandler * handler)
{
- return "dvb://";
+ return g_strdup ("dvb://");
}
static gboolean
-dvb_base_bin_uri_set_uri (GstURIHandler * handler, const gchar * uri)
+dvb_base_bin_uri_set_uri (GstURIHandler * handler, const gchar * uri,
+ GError ** error)
{
- gboolean ret;
- gchar *protocol;
DvbBaseBin *dvbbasebin = GST_DVB_BASE_BIN (handler);
+ gchar *location;
- protocol = gst_uri_get_protocol (uri);
+ location = gst_uri_get_location (uri);
- if (strcmp (protocol, "dvb") != 0) {
- ret = FALSE;
- } else {
- gchar *location = gst_uri_get_location (uri);
+ if (location == NULL)
+ goto no_location;
- if (location != NULL) {
- ret = set_properties_for_channel (G_OBJECT (dvbbasebin), location);
- g_free (location);
- } else
- ret = FALSE;
- }
+ if (!set_properties_for_channel (G_OBJECT (dvbbasebin), location))
+ goto set_properties_failed;
- /* here is where we parse channels.conf */
- g_free (protocol);
+ /* FIXME: here is where we parse channels.conf */
- return ret;
+ g_free (location);
+ return TRUE;
+/* ERRORS */
+no_location:
+ {
+ g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI,
+ "No details to DVB URI");
+ return FALSE;
+ }
+set_properties_failed:
+ {
+ g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI,
+ "Could not set properties from DVB URI");
+ g_free (location);
+ return FALSE;
+ }
}
static void