From 956008e6c3258a4ede2f972f03d86969c5f67a7d Mon Sep 17 00:00:00 2001 From: Matthew Allum Date: Tue, 17 May 2005 10:12:10 +0000 Subject: [PATCH] playback fixes --- ChangeLog | 8 ++++++++ clutter/cltr-video.c | 2 +- gst/cltrimagesink.c | 16 ++++++++++++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9688c036e..456dd5959 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-05-17 mallum,,, + + * clutter/cltr-video.c: (cltr_video_get_pixbuf): + * gst/cltrimagesink.c: (gst_cltrimagesink_change_state), + (gst_cltrimagesink_chain): + Fix thread related segv's on grabbing video image. + Also pop any unplayed data from sink on stop + 2005-05-16 mallum,,, * clutter/cltr-animator.c: (cltr_animator_zoom_new), diff --git a/clutter/cltr-video.c b/clutter/cltr-video.c index a1fbe9dc7..869ccf774 100644 --- a/clutter/cltr-video.c +++ b/clutter/cltr-video.c @@ -715,7 +715,7 @@ cltr_video_get_pixbuf (CltrVideo *video) { Pixbuf *pixb = NULL; - if (video->frame_texture) + /* if (video->frame_texture) */ { cltr_texture_lock(video->frame_texture); diff --git a/gst/cltrimagesink.c b/gst/cltrimagesink.c index 7643fd417..485043bea 100644 --- a/gst/cltrimagesink.c +++ b/gst/cltrimagesink.c @@ -254,23 +254,33 @@ gst_cltrimagesink_change_state (GstElement * element) return GST_STATE_FAILURE; } */ + DBG("GST_STATE_NULL_TO_READY"); break; case GST_STATE_READY_TO_PAUSED: + DBG("GST_STATE_READY_TO_PAUSED"); cltrimagesink->time = 0; break; case GST_STATE_PAUSED_TO_PLAYING: + DBG("GST_STATE_PAUSED_TO_PLAYING"); break; case GST_STATE_PLAYING_TO_PAUSED: + DBG("GST_STATE_PLAYING_TO_PAUSED"); break; case GST_STATE_PAUSED_TO_READY: + DBG("GST_STATE_PAUSED_TO_READY"); + + while (g_async_queue_try_pop (cltrimagesink->queue)) ; + cltrimagesink->framerate = 0; GST_VIDEOSINK_WIDTH (cltrimagesink) = 0; GST_VIDEOSINK_HEIGHT (cltrimagesink) = 0; break; case GST_STATE_READY_TO_NULL: + DBG("GST_STATE_READY_TO_NULL"); + /* if (cltrimagesink->texture) cltr_texture_unref(cltrimagesink->texture); - + */ break; } @@ -320,7 +330,9 @@ gst_cltrimagesink_chain (GstPad * pad, GstData * data) /* if we have one... */ - if (cltrimagesink->texture) + if (cltrimagesink->texture + && GST_VIDEOSINK_WIDTH (cltrimagesink) + && GST_VIDEOSINK_HEIGHT (cltrimagesink)) { /* need to copy the data into out pixbuf here */ Pixbuf *pixb = NULL;