mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 00:06:36 +00:00
value: just compute strlen() once
This commit is contained in:
parent
15141b3954
commit
c95a85f6cf
1 changed files with 5 additions and 4 deletions
|
@ -723,17 +723,18 @@ gst_value_deserialize_fourcc (GValue * dest, const char *s)
|
|||
gboolean ret = FALSE;
|
||||
guint32 fourcc = 0;
|
||||
char *end;
|
||||
gint l = strlen (s);
|
||||
|
||||
if (strlen (s) == 4) {
|
||||
if (l == 4) {
|
||||
fourcc = GST_MAKE_FOURCC (s[0], s[1], s[2], s[3]);
|
||||
ret = TRUE;
|
||||
} else if (strlen (s) == 3) {
|
||||
} else if (l == 3) {
|
||||
fourcc = GST_MAKE_FOURCC (s[0], s[1], s[2], ' ');
|
||||
ret = TRUE;
|
||||
} else if (strlen (s) == 2) {
|
||||
} else if (l == 2) {
|
||||
fourcc = GST_MAKE_FOURCC (s[0], s[1], ' ', ' ');
|
||||
ret = TRUE;
|
||||
} else if (strlen (s) == 1) {
|
||||
} else if (l == 1) {
|
||||
fourcc = GST_MAKE_FOURCC (s[0], ' ', ' ', ' ');
|
||||
ret = TRUE;
|
||||
} else if (g_ascii_isdigit (*s)) {
|
||||
|
|
Loading…
Reference in a new issue