mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
ges: Simplify init/deinit flag
In theory, GES can be init/deinit multiple times in a process. To simplify that use-case, let's trace only "ges_initialized" flag.
This commit is contained in:
parent
87925a72da
commit
2f491b60c8
1 changed files with 3 additions and 9 deletions
12
ges/ges.c
12
ges/ges.c
|
@ -48,7 +48,6 @@ GST_DEBUG_CATEGORY (_ges_debug);
|
||||||
G_LOCK_DEFINE_STATIC (init_lock);
|
G_LOCK_DEFINE_STATIC (init_lock);
|
||||||
|
|
||||||
static gboolean ges_initialized = FALSE;
|
static gboolean ges_initialized = FALSE;
|
||||||
static gboolean ges_deinitialized = FALSE;
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
ges_init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
|
ges_init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
|
||||||
|
@ -179,16 +178,11 @@ ges_deinit (void)
|
||||||
{
|
{
|
||||||
G_LOCK (init_lock);
|
G_LOCK (init_lock);
|
||||||
|
|
||||||
if (!ges_initialized) {
|
|
||||||
G_UNLOCK (init_lock);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
GST_INFO ("deinitializing GES");
|
GST_INFO ("deinitializing GES");
|
||||||
|
|
||||||
if (ges_deinitialized) {
|
if (!ges_initialized) {
|
||||||
|
GST_DEBUG ("nothing to deinitialize");
|
||||||
G_UNLOCK (init_lock);
|
G_UNLOCK (init_lock);
|
||||||
GST_DEBUG ("already deinitialized");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,7 +213,7 @@ ges_deinit (void)
|
||||||
|
|
||||||
ges_asset_cache_deinit ();
|
ges_asset_cache_deinit ();
|
||||||
|
|
||||||
ges_deinitialized = TRUE;
|
ges_initialized = FALSE;
|
||||||
G_UNLOCK (init_lock);
|
G_UNLOCK (init_lock);
|
||||||
|
|
||||||
GST_INFO ("deinitialized GES");
|
GST_INFO ("deinitialized GES");
|
||||||
|
|
Loading…
Reference in a new issue