mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
ges: Plug some leaks
This commit is contained in:
parent
ae6124e282
commit
dcb3ad620d
8 changed files with 29 additions and 9 deletions
|
@ -367,7 +367,7 @@ gboolean
|
||||||
_ges_add_clip_from_struct (GESTimeline * timeline, GstStructure * structure,
|
_ges_add_clip_from_struct (GESTimeline * timeline, GstStructure * structure,
|
||||||
GError ** error)
|
GError ** error)
|
||||||
{
|
{
|
||||||
GESAsset *asset;
|
GESAsset *asset = NULL;
|
||||||
GESLayer *layer;
|
GESLayer *layer;
|
||||||
GESClip *clip;
|
GESClip *clip;
|
||||||
gint layer_priority;
|
gint layer_priority;
|
||||||
|
@ -546,6 +546,7 @@ _ges_add_clip_from_struct (GESTimeline * timeline, GstStructure * structure,
|
||||||
res = _ges_save_timeline_if_needed (timeline, structure, error);
|
res = _ges_save_timeline_if_needed (timeline, structure, error);
|
||||||
|
|
||||||
beach:
|
beach:
|
||||||
|
gst_clear_object (&asset);
|
||||||
g_free (asset_id);
|
g_free (asset_id);
|
||||||
g_free (check_asset_id);
|
g_free (check_asset_id);
|
||||||
return res;
|
return res;
|
||||||
|
@ -555,7 +556,7 @@ gboolean
|
||||||
_ges_container_add_child_from_struct (GESTimeline * timeline,
|
_ges_container_add_child_from_struct (GESTimeline * timeline,
|
||||||
GstStructure * structure, GError ** error)
|
GstStructure * structure, GError ** error)
|
||||||
{
|
{
|
||||||
GESAsset *asset;
|
GESAsset *asset = NULL;
|
||||||
GESContainer *container;
|
GESContainer *container;
|
||||||
GESTimelineElement *child = NULL;
|
GESTimelineElement *child = NULL;
|
||||||
const gchar *container_name, *child_name, *child_type, *id;
|
const gchar *container_name, *child_name, *child_type, *id;
|
||||||
|
@ -640,6 +641,7 @@ _ges_container_add_child_from_struct (GESTimeline * timeline,
|
||||||
res = _ges_save_timeline_if_needed (timeline, structure, error);
|
res = _ges_save_timeline_if_needed (timeline, structure, error);
|
||||||
|
|
||||||
beach:
|
beach:
|
||||||
|
gst_clear_object (&asset);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1028,6 +1028,9 @@ timeline_get_framerate (GESTimeline * self, gint * fps_n, gint * fps_d)
|
||||||
GstCaps *restriction = ges_track_get_restriction_caps (tmp->data);
|
GstCaps *restriction = ges_track_get_restriction_caps (tmp->data);
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
|
if (!restriction)
|
||||||
|
continue;
|
||||||
|
|
||||||
for (i = 0; i < gst_caps_get_size (restriction); i++) {
|
for (i = 0; i < gst_caps_get_size (restriction); i++) {
|
||||||
gint n, d;
|
gint n, d;
|
||||||
|
|
||||||
|
|
|
@ -919,6 +919,8 @@ _ges_uri_asset_cleanup (void)
|
||||||
g_hash_table_destroy (discoverers);
|
g_hash_table_destroy (discoverers);
|
||||||
discoverers = NULL;
|
discoverers = NULL;
|
||||||
}
|
}
|
||||||
|
gst_clear_object (&GES_URI_CLIP_ASSET_CLASS (g_type_class_peek
|
||||||
|
(GES_TYPE_URI_CLIP_ASSET))->discoverer);
|
||||||
G_UNLOCK (discoverers_lock);
|
G_UNLOCK (discoverers_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -946,7 +948,7 @@ _ges_uri_asset_ensure_setup (gpointer uriasset_class)
|
||||||
if (errno)
|
if (errno)
|
||||||
timeout = DEFAULT_DISCOVERY_TIMEOUT;
|
timeout = DEFAULT_DISCOVERY_TIMEOUT;
|
||||||
|
|
||||||
if (!discoverer) {
|
if (!klass->discoverer) {
|
||||||
discoverer = gst_discoverer_new (timeout, &err);
|
discoverer = gst_discoverer_new (timeout, &err);
|
||||||
if (!discoverer) {
|
if (!discoverer) {
|
||||||
GST_ERROR ("Could not create discoverer: %s", err->message);
|
GST_ERROR ("Could not create discoverer: %s", err->message);
|
||||||
|
|
|
@ -234,7 +234,7 @@ _add_asset (GstValidateScenario * scenario, GstValidateAction * action)
|
||||||
const gchar *id = NULL;
|
const gchar *id = NULL;
|
||||||
const gchar *type_string = NULL;
|
const gchar *type_string = NULL;
|
||||||
GType type;
|
GType type;
|
||||||
GESAsset *asset;
|
GESAsset *asset = NULL;
|
||||||
gboolean res = FALSE;
|
gboolean res = FALSE;
|
||||||
GESProject *project;
|
GESProject *project;
|
||||||
DECLARE_AND_GET_TIMELINE (scenario, action);
|
DECLARE_AND_GET_TIMELINE (scenario, action);
|
||||||
|
@ -269,6 +269,7 @@ _add_asset (GstValidateScenario * scenario, GstValidateAction * action)
|
||||||
SAVE_TIMELINE_IF_NEEDED (scenario, timeline, action);
|
SAVE_TIMELINE_IF_NEEDED (scenario, timeline, action);
|
||||||
|
|
||||||
beach:
|
beach:
|
||||||
|
gst_clear_object (&asset);
|
||||||
g_object_unref (timeline);
|
g_object_unref (timeline);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -544,12 +545,15 @@ _commit (GstValidateScenario * scenario, GstValidateAction * action)
|
||||||
action);
|
action);
|
||||||
gst_object_unref (timeline);
|
gst_object_unref (timeline);
|
||||||
gst_object_unref (bus);
|
gst_object_unref (bus);
|
||||||
|
gst_object_unref (pipeline);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
SAVE_TIMELINE_IF_NEEDED (scenario, timeline, action);
|
||||||
|
|
||||||
gst_object_unref (bus);
|
gst_object_unref (bus);
|
||||||
gst_object_unref (timeline);
|
gst_object_unref (timeline);
|
||||||
SAVE_TIMELINE_IF_NEEDED (scenario, timeline, action);
|
gst_object_unref (pipeline);
|
||||||
|
|
||||||
return GST_VALIDATE_EXECUTE_ACTION_ASYNC;
|
return GST_VALIDATE_EXECUTE_ACTION_ASYNC;
|
||||||
}
|
}
|
||||||
|
@ -1170,6 +1174,7 @@ _load_project (GstValidateScenario * scenario, GstValidateAction * action)
|
||||||
gst_element_set_state (pipeline, state);
|
gst_element_set_state (pipeline, state);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
gst_object_unref (pipeline);
|
||||||
if (error)
|
if (error)
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
|
|
|
@ -79,10 +79,17 @@ if gstvalidate_dep.found()
|
||||||
'check_edit_in_frames_with_framerate_mismatch',
|
'check_edit_in_frames_with_framerate_mismatch',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
env = environment()
|
||||||
|
env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
|
||||||
|
env.set('GST_STATE_IGNORE_ELEMENTS', '')
|
||||||
|
env.set('CK_DEFAULT_TIMEOUT', '20')
|
||||||
|
env.set('GST_REGISTRY', '@0@/@1@.registry'.format(meson.current_build_dir(), 'scenarios'))
|
||||||
|
env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs)
|
||||||
foreach scenario: scenarios
|
foreach scenario: scenarios
|
||||||
scenario_file = join_paths(meson.current_source_dir(), 'scenarios', scenario + '.scenario')
|
scenario_file = join_paths(meson.current_source_dir(), 'scenarios', scenario + '.scenario')
|
||||||
test(scenario, ges_launch, env: env, args: ['--set-scenario', scenario_file])
|
test(scenario, ges_launch, env: env, args: ['--set-scenario', scenario_file])
|
||||||
endforeach
|
endforeach
|
||||||
|
test('simple_playback_test', ges_launch, env: env, args: ['+test-clip', 'blue', 'd=0.1', '--disable-validate', '--videosink=fakevideosink', '--audiosink=fakesink'])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if build_gir
|
if build_gir
|
||||||
|
|
|
@ -38,6 +38,7 @@ main (int argc, gchar ** argv)
|
||||||
ret = ges_launcher_get_exit_status (launcher);
|
ret = ges_launcher_get_exit_status (launcher);
|
||||||
|
|
||||||
g_object_unref (launcher);
|
g_object_unref (launcher);
|
||||||
|
ges_deinit ();
|
||||||
gst_deinit ();
|
gst_deinit ();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -262,6 +262,7 @@ _create_timeline (GESLauncher * self, const gchar * serialized_timeline,
|
||||||
|
|
||||||
self->priv->timeline =
|
self->priv->timeline =
|
||||||
GES_TIMELINE (ges_asset_extract (GES_ASSET (project), &error));
|
GES_TIMELINE (ges_asset_extract (GES_ASSET (project), &error));
|
||||||
|
gst_object_unref (project);
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
printerr ("\nERROR: Could not create timeline because: %s\n\n",
|
printerr ("\nERROR: Could not create timeline because: %s\n\n",
|
||||||
|
|
|
@ -174,11 +174,10 @@ ges_validate_clean (GstPipeline * pipeline)
|
||||||
res = gst_validate_runner_exit (runner, TRUE);
|
res = gst_validate_runner_exit (runner, TRUE);
|
||||||
|
|
||||||
gst_object_unref (pipeline);
|
gst_object_unref (pipeline);
|
||||||
if (runner) {
|
if (runner)
|
||||||
gst_object_unref (runner);
|
gst_object_unref (runner);
|
||||||
if (monitor)
|
if (monitor)
|
||||||
gst_object_unref (monitor);
|
gst_object_unref (monitor);
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue