From f5868babedbaa2e2129ae63a8114a44171c86d50 Mon Sep 17 00:00:00 2001 From: cedric Date: Fri, 24 Jun 2011 14:52:59 +0000 Subject: [PATCH] emotion: fix shutdown of gstreamer plugin. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/emotion@60666 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/modules/gstreamer/emotion_gstreamer.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/modules/gstreamer/emotion_gstreamer.c b/src/modules/gstreamer/emotion_gstreamer.c index 0c3f6fd..1712184 100644 --- a/src/modules/gstreamer/emotion_gstreamer.c +++ b/src/modules/gstreamer/emotion_gstreamer.c @@ -353,13 +353,18 @@ em_shutdown(void *video) if (!ev) return 0; + if (ev->pipeline) + { + gst_element_set_state(ev->pipeline, GST_STATE_NULL); + gst_object_unref(ev->pipeline); + ev->pipeline = NULL; + } + EINA_LIST_FREE(ev->audio_streams, astream) free(astream); EINA_LIST_FREE(ev->video_streams, vstream) free(vstream); - gst_deinit(); - free(ev); return 1; @@ -670,6 +675,12 @@ em_file_close(void *video) if (!ev) return; + if (ev->eos_bus) + { + gst_object_unref(GST_OBJECT(ev->eos_bus)); + ev->eos_bus = NULL; + } + /* we clear the stream lists */ EINA_LIST_FREE(ev->audio_streams, astream) free(astream); @@ -683,24 +694,11 @@ em_file_close(void *video) ev->eos_timer = NULL; } - if (ev->eos_bus) - { - gst_object_unref(GST_OBJECT(ev->eos_bus)); - ev->eos_bus = NULL; - } - if (ev->metadata) { _free_metadata(ev->metadata); ev->metadata = NULL; } - - if (ev->pipeline) - { - gst_element_set_state(ev->pipeline, GST_STATE_NULL); - gst_object_unref(ev->pipeline); - ev->pipeline = NULL; - } } static void @@ -1415,6 +1413,8 @@ void gstreamer_module_shutdown(void) { _emotion_module_unregister("gstreamer"); + + gst_deinit(); } #ifndef EMOTION_STATIC_BUILD_GSTREAMER -- 2.7.4