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:
Rodrigo Bernardes 2023-01-04 18:55:08 -03:00 committed by GStreamer Marge Bot
parent 023c67e166
commit 28f7a0ed2e

View file

@ -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;
}