From: cedric Date: Fri, 24 Jun 2011 14:52:59 +0000 (+0000) Subject: emotion: fix shutdown of gstreamer plugin. X-Git-Tag: submit/2.0alpha-wayland/20121127.222018~250 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5be71e5e8a7a47892ea3995693baa9416459a143;p=profile%2Fivi%2Femotion.git emotion: fix shutdown of gstreamer plugin. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/emotion@60666 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- 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