aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-09-14 22:33:41 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-09-14 22:33:41 +0000
commit8cc23a119e3fbbaacdbf59ae88ec2758b017d763 (patch)
tree1b88fabe3a2e816aa51f21a3f5cb0539cc567635
parenteina: fix eina inlist sorted insert (with and without state) (diff)
downloadefl-8cc23a119e3fbbaacdbf59ae88ec2758b017d763.tar.gz
emotion: correctly destroy buffer.
SVN revision: 63399
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c16
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_sink.c20
2 files changed, 24 insertions, 12 deletions
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
index d75d1b89e8..6a27d9c017 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
@@ -379,19 +379,21 @@ em_shutdown(void *video)
ev->eos_bus = NULL;
}
+ if (ev->last_buffer)
+ {
+ gst_buffer_unref(ev->last_buffer);
+ ev->last_buffer = NULL;
+ }
+
if (ev->pipeline)
{
+ gstreamer_video_sink_new(ev, ev->obj, NULL);
+
g_object_set(G_OBJECT(ev->sink), "ev", NULL, NULL);
g_object_set(G_OBJECT(ev->sink), "evas-object", NULL, NULL);
gst_element_set_state(ev->pipeline, GST_STATE_NULL);
gst_object_unref(ev->pipeline);
- if (ev->last_buffer)
- {
- gst_buffer_unref(ev->last_buffer);
- ev->last_buffer = NULL;
- }
-
ev->pipeline = NULL;
ev->sink = NULL;
}
@@ -497,6 +499,8 @@ em_file_close(void *video)
if (ev->pipeline)
{
+ gstreamer_video_sink_new(ev, ev->obj, NULL);
+
g_object_set(G_OBJECT(ev->sink), "ev", NULL, NULL);
g_object_set(G_OBJECT(ev->sink), "evas-object", NULL, NULL);
gst_element_set_state(ev->pipeline, GST_STATE_NULL);
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_sink.c b/legacy/emotion/src/modules/gstreamer/emotion_sink.c
index 32e80b51e3..d71d5fa510 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_sink.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_sink.c
@@ -801,20 +801,25 @@ evas_video_sink_main_render(void *data)
_emotion_frame_new(ev->obj);
- vstream = eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1);
-
gst_element_query_position(ev->pipeline, &fmt, &pos);
ev->position = (double)pos / (double)GST_SECOND;
- vstream->width = priv->width;
- vstream->height = priv->height;
+ vstream = eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1);
+
+ if (vstream)
+ {
+ vstream->width = priv->width;
+ vstream->height = priv->height;
+ _emotion_video_pos_update(ev->obj, ev->position, vstream->length_time);
+ }
+
ev->ratio = (double) priv->width / (double) priv->height;
- _emotion_video_pos_update(ev->obj, ev->position, vstream->length_time);
_emotion_frame_resize(ev->obj, priv->width, priv->height, ev->ratio);
+ buffer = gst_buffer_ref(buffer);
if (ev->last_buffer) gst_buffer_unref(ev->last_buffer);
- ev->last_buffer = gst_buffer_ref(buffer);
+ ev->last_buffer = buffer;
exit_point:
emotion_gstreamer_buffer_free(send);
@@ -1010,6 +1015,9 @@ gstreamer_video_sink_new(Emotion_Gstreamer_Video *ev,
evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE, _on_resize_fill, ev);
evas_event_callback_del_full(evas_object_evas_get(obj), EVAS_CALLBACK_RENDER_FLUSH_POST, _on_post_clear, ev);
+ if (!uri)
+ return NULL;
+
playbin = gst_element_factory_make("playbin2", "playbin");
if (!playbin)
{