Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gstreamer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2021-03-17 16:06:51 +0300
committerMathieu Duponchelle <mathieu@centricular.com>2021-03-17 16:11:39 +0300
commit12661d90a3a4202c579e184b95316fedd895fa71 (patch)
treebe9c8546aff9f261cbd3904ff36d664245d2950f
parent44bdad58f623e50a07476c0f40f8ff7543396f7c (diff)
value: fix parsing of explicit value casts
Since acdb4ce03d525a18f6c351a040b8446c7bbd98bd , parsing of the value for a property can use the pspec to determine what type a value should be casted to. However, this broke the case where the value is explicitly casted to a type (eg <(float) 0.0>). In that situation, we want to respect the casting decision, and only use the pspec to perform "implicit" casts. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/881 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/772>
-rw-r--r--gst/gstvalue.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gst/gstvalue.c b/gst/gstvalue.c
index 607978c34f..66035a7148 100644
--- a/gst/gstvalue.c
+++ b/gst/gstvalue.c
@@ -2754,9 +2754,7 @@ _priv_gst_value_parse_value (gchar * str,
/* check if there's a (type_name) 'cast' */
type_name = NULL;
- if (pspec) {
- type = G_PARAM_SPEC_VALUE_TYPE (pspec);
- } else if (*s == '(') {
+ if (*s == '(') {
s++;
while (g_ascii_isspace (*s))
s++;
@@ -2782,6 +2780,8 @@ _priv_gst_value_parse_value (gchar * str,
GST_WARNING ("invalid type");
return FALSE;
}
+ } else if (pspec) {
+ type = G_PARAM_SPEC_VALUE_TYPE (pspec);
}
while (g_ascii_isspace (*s))