summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>2016-08-16 15:35:39 -0700
committerReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>2016-08-18 11:17:14 -0700
commitc40e49c9b1b4da6822aba37f2c137ff4f8d4605e (patch)
tree5cc998c4c70c9d18548ba8f1c3dd0679363ec0a7
parent0d06f4bc7c6af1935cc595b93ef3f7abf1b6f4b0 (diff)
dvb/parsechannels: handle problems parsing dvbv5 config keys
-rw-r--r--sys/dvb/parsechannels.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/sys/dvb/parsechannels.c b/sys/dvb/parsechannels.c
index 1d63eb8a9..4837e2797 100644
--- a/sys/dvb/parsechannels.c
+++ b/sys/dvb/parsechannels.c
@@ -99,7 +99,6 @@ gst_dvb_base_bin_conf_set_property_from_string_array (GstElement * dvbbasebin,
return TRUE;
}
-/* TODO handle errors when getting keyfile data on all these functions */
static gboolean
gst_dvb_base_bin_conf_set_string (GstElement * dvbbasebin,
const gchar * property, GKeyFile * kf, const gchar * channel_name,
@@ -108,6 +107,12 @@ gst_dvb_base_bin_conf_set_string (GstElement * dvbbasebin,
gchar *str;
str = g_key_file_get_string (kf, channel_name, key, NULL);
+ if (!str) {
+ GST_WARNING_OBJECT (dvbbasebin,
+ "Could not get value for '%s' on channel '%s'", key, channel_name);
+ return FALSE;
+ }
+
g_object_set (dvbbasebin, property, str, NULL);
g_free (str);
return TRUE;
@@ -120,6 +125,12 @@ gst_dvb_base_bin_conf_set_uint (GstElement * dvbbasebin, const gchar * property,
guint64 v;
v = g_key_file_get_uint64 (kf, channel_name, key, NULL);
+ if (!v) {
+ GST_WARNING_OBJECT (dvbbasebin,
+ "Could not get value for '%s' on channel '%s'", key, channel_name);
+ return FALSE;
+ }
+
g_object_set (dvbbasebin, property, (guint) v, NULL);
return TRUE;
}
@@ -131,6 +142,12 @@ gst_dvb_base_bin_conf_set_int (GstElement * dvbbasebin, const gchar * property,
gint v;
v = g_key_file_get_integer (kf, channel_name, key, NULL);
+ if (!v) {
+ GST_WARNING_OBJECT (dvbbasebin,
+ "Could not get value for '%s' on channel '%s'", key, channel_name);
+ return FALSE;
+ }
+
g_object_set (dvbbasebin, property, v, NULL);
return TRUE;
}
@@ -144,6 +161,12 @@ gst_dvb_base_bin_conf_set_inversion (GstElement * dvbbasebin,
gint v;
str = g_key_file_get_string (kf, channel_name, key, NULL);
+ if (!str) {
+ GST_WARNING_OBJECT (dvbbasebin,
+ "Could not get value for '%s' on channel '%s'", key, channel_name);
+ return FALSE;
+ }
+
if (strcmp (str, "AUTO") == 0)
v = 2;
else if (strcmp (str, "ON") == 0)