From 28f7a0ed2e461acb1bb6a1070f4c78867d06be8a Mon Sep 17 00:00:00 2001 From: Rodrigo Bernardes Date: Wed, 4 Jan 2023 18:55:08 -0300 Subject: [PATCH] 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: --- .../gst-plugins-bad/sys/dvb/parsechannels.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/dvb/parsechannels.c b/subprojects/gst-plugins-bad/sys/dvb/parsechannels.c index cd1dfb72c6..2762def06d 100644 --- a/subprojects/gst-plugins-bad/sys/dvb/parsechannels.c +++ b/subprojects/gst-plugins-bad/sys/dvb/parsechannels.c @@ -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) { guint64 v; + GError *err = NULL; - v = g_key_file_get_uint64 (kf, channel_name, key, NULL); - if (!v) { + v = g_key_file_get_uint64 (kf, channel_name, key, &err); + if (err != NULL) { 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; } @@ -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) { gint v; + GError *err = NULL; - v = g_key_file_get_integer (kf, channel_name, key, NULL); - if (!v) { + v = g_key_file_get_integer (kf, channel_name, key, &err); + if (err != NULL) { 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; }