mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 11:29:55 +00:00
tracerutils: allow casting parameters types
It was impossible to have an u32 parameter such as 'max-buffer-size=(uint)5' because the parentheses were not properly parsed. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3981>
This commit is contained in:
parent
4769a2ab97
commit
767ee35265
1 changed files with 15 additions and 1 deletions
|
@ -100,7 +100,21 @@ _priv_gst_tracing_init (void)
|
||||||
while (t[i]) {
|
while (t[i]) {
|
||||||
// check t[i] for params
|
// check t[i] for params
|
||||||
if ((params = strchr (t[i], '('))) {
|
if ((params = strchr (t[i], '('))) {
|
||||||
gchar *end = strchr (¶ms[1], ')');
|
// params can contain multiple '(' when using this kind of parameter: 'max-buffer-size=(uint)5'
|
||||||
|
guint n_par = 1, j;
|
||||||
|
gchar *end = NULL;
|
||||||
|
|
||||||
|
for (j = 1; params[j] != '\0'; j++) {
|
||||||
|
if (params[j] == '(')
|
||||||
|
n_par++;
|
||||||
|
else if (params[j] == ')') {
|
||||||
|
n_par--;
|
||||||
|
if (n_par == 0) {
|
||||||
|
end = ¶ms[j];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
*params = '\0';
|
*params = '\0';
|
||||||
params++;
|
params++;
|
||||||
if (end)
|
if (end)
|
||||||
|
|
Loading…
Reference in a new issue