mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
dvb/parsechannels: handle problems parsing dvbv5 config keys
This commit is contained in:
parent
0d06f4bc7c
commit
c40e49c9b1
1 changed files with 24 additions and 1 deletions
|
@ -99,7 +99,6 @@ gst_dvb_base_bin_conf_set_property_from_string_array (GstElement * dvbbasebin,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO handle errors when getting keyfile data on all these functions */
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_dvb_base_bin_conf_set_string (GstElement * dvbbasebin,
|
gst_dvb_base_bin_conf_set_string (GstElement * dvbbasebin,
|
||||||
const gchar * property, GKeyFile * kf, const gchar * channel_name,
|
const gchar * property, GKeyFile * kf, const gchar * channel_name,
|
||||||
|
@ -108,6 +107,12 @@ gst_dvb_base_bin_conf_set_string (GstElement * dvbbasebin,
|
||||||
gchar *str;
|
gchar *str;
|
||||||
|
|
||||||
str = g_key_file_get_string (kf, channel_name, key, NULL);
|
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_object_set (dvbbasebin, property, str, NULL);
|
||||||
g_free (str);
|
g_free (str);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -120,6 +125,12 @@ gst_dvb_base_bin_conf_set_uint (GstElement * dvbbasebin, const gchar * property,
|
||||||
guint64 v;
|
guint64 v;
|
||||||
|
|
||||||
v = g_key_file_get_uint64 (kf, channel_name, key, NULL);
|
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);
|
g_object_set (dvbbasebin, property, (guint) v, NULL);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -131,6 +142,12 @@ gst_dvb_base_bin_conf_set_int (GstElement * dvbbasebin, const gchar * property,
|
||||||
gint v;
|
gint v;
|
||||||
|
|
||||||
v = g_key_file_get_integer (kf, channel_name, key, NULL);
|
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);
|
g_object_set (dvbbasebin, property, v, NULL);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -144,6 +161,12 @@ gst_dvb_base_bin_conf_set_inversion (GstElement * dvbbasebin,
|
||||||
gint v;
|
gint v;
|
||||||
|
|
||||||
str = g_key_file_get_string (kf, channel_name, key, NULL);
|
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)
|
if (strcmp (str, "AUTO") == 0)
|
||||||
v = 2;
|
v = 2;
|
||||||
else if (strcmp (str, "ON") == 0)
|
else if (strcmp (str, "ON") == 0)
|
||||||
|
|
Loading…
Reference in a new issue