mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:56:14 +00:00
ges-launch: use GRegex instead of POSIX regex
http://bugzilla-attachments.gnome.org/attachment.cgi?id=212249
This commit is contained in:
parent
fdb06182fa
commit
59e156ea3a
1 changed files with 5 additions and 7 deletions
|
@ -28,7 +28,6 @@
|
||||||
#include <glib/gprintf.h>
|
#include <glib/gprintf.h>
|
||||||
#include <ges/ges.h>
|
#include <ges/ges.h>
|
||||||
#include <gst/pbutils/encoding-profile.h>
|
#include <gst/pbutils/encoding-profile.h>
|
||||||
#include <regex.h>
|
|
||||||
|
|
||||||
/* GLOBAL VARIABLE */
|
/* GLOBAL VARIABLE */
|
||||||
static guint repeat = 0;
|
static guint repeat = 0;
|
||||||
|
@ -93,16 +92,15 @@ check_path (char *path)
|
||||||
static gboolean
|
static gboolean
|
||||||
check_time (char *time)
|
check_time (char *time)
|
||||||
{
|
{
|
||||||
static regex_t re;
|
static GRegex *re = NULL;
|
||||||
static gboolean compiled = FALSE;
|
|
||||||
|
|
||||||
if (!compiled) {
|
if (!re) {
|
||||||
compiled = TRUE;
|
if (NULL == (re = g_regex_new ("^[0-9]+(.[0-9]+)?$", G_REGEX_EXTENDED, 0,
|
||||||
if (regcomp (&re, "^[0-9]+(.[0-9]+)?$", REG_EXTENDED | REG_NOSUB))
|
NULL)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!regexec (&re, time, (size_t) 0, NULL, 0))
|
if (g_regex_match (re, time, 0, NULL))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue