playback fixes
authorMatthew Allum <mallum@openedhand.com>
Tue, 17 May 2005 10:12:10 +0000 (10:12 +0000)
committerMatthew Allum <mallum@openedhand.com>
Tue, 17 May 2005 10:12:10 +0000 (10:12 +0000)
ChangeLog
clutter/cltr-video.c
gst/cltrimagesink.c

index 9688c03..456dd59 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-05-17  mallum,,,  <mallum@openedhand.com>
+
+       * 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,,,  <mallum@openedhand.com>
 
        * clutter/cltr-animator.c: (cltr_animator_zoom_new),
index a1fbe9d..869ccf7 100644 (file)
@@ -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);
 
index 7643fd4..485043b 100644 (file)
@@ -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;