mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
dvbbasebin: don't rely on g_key_file_get_(integer|uint64) return
instead check if an error was returned, and fail if any Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3688>
This commit is contained in:
parent
023c67e166
commit
28f7a0ed2e
1 changed files with 12 additions and 6 deletions
|
@ -212,11 +212,14 @@ gst_dvb_base_bin_conf_set_uint (GstElement * dvbbasebin, const gchar * property,
|
||||||
GKeyFile * kf, const gchar * channel_name, const gchar * key)
|
GKeyFile * kf, const gchar * channel_name, const gchar * key)
|
||||||
{
|
{
|
||||||
guint64 v;
|
guint64 v;
|
||||||
|
GError *err = NULL;
|
||||||
|
|
||||||
v = g_key_file_get_uint64 (kf, channel_name, key, NULL);
|
v = g_key_file_get_uint64 (kf, channel_name, key, &err);
|
||||||
if (!v) {
|
if (err != NULL) {
|
||||||
GST_WARNING_OBJECT (dvbbasebin,
|
GST_WARNING_OBJECT (dvbbasebin,
|
||||||
"Could not get value for '%s' on channel '%s'", key, channel_name);
|
"Could not get value for '%s' on channel '%s' error: '%s'", key,
|
||||||
|
channel_name, err->message);
|
||||||
|
g_error_free (err);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,11 +232,14 @@ gst_dvb_base_bin_conf_set_int (GstElement * dvbbasebin, const gchar * property,
|
||||||
GKeyFile * kf, const gchar * channel_name, const gchar * key)
|
GKeyFile * kf, const gchar * channel_name, const gchar * key)
|
||||||
{
|
{
|
||||||
gint v;
|
gint v;
|
||||||
|
GError *err = NULL;
|
||||||
|
|
||||||
v = g_key_file_get_integer (kf, channel_name, key, NULL);
|
v = g_key_file_get_integer (kf, channel_name, key, &err);
|
||||||
if (!v) {
|
if (err != NULL) {
|
||||||
GST_WARNING_OBJECT (dvbbasebin,
|
GST_WARNING_OBJECT (dvbbasebin,
|
||||||
"Could not get value for '%s' on channel '%s'", key, channel_name);
|
"Could not get value for '%s' on channel '%s' error: '%s'", key,
|
||||||
|
channel_name, err->message);
|
||||||
|
g_error_free (err);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue