[longomatch] editor: fix deadlock cancelling export



commit fe5005f7a3e3c53c644544789b3b7ad040e70f04
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Apr 2 01:21:56 2014 +0200

    editor: fix deadlock cancelling export

 libcesarplayer/gst-video-editor.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/libcesarplayer/gst-video-editor.c b/libcesarplayer/gst-video-editor.c
index 9ec1982..1c89c0d 100644
--- a/libcesarplayer/gst-video-editor.c
+++ b/libcesarplayer/gst-video-editor.c
@@ -610,6 +610,13 @@ gst_video_editor_start (GstVideoEditor * gve)
   g_signal_emit (gve, gve_signals[SIGNAL_PERCENT_COMPLETED], 0, (gfloat) 0);
 }
 
+static void
+_set_state_threaded (GstVideoEditor *gve)
+{
+  gst_element_set_state (gve->priv->main_pipeline, GST_STATE_NULL);
+  g_signal_emit (gve, gve_signals[SIGNAL_PERCENT_COMPLETED], 0, (gfloat) - 1);
+}
+
 void
 gst_video_editor_cancel (GstVideoEditor * gve)
 {
@@ -620,8 +627,7 @@ gst_video_editor_cancel (GstVideoEditor * gve)
     g_source_remove (gve->priv->update_id);
     gve->priv->update_id = 0;
   }
-  gst_element_set_state (gve->priv->main_pipeline, GST_STATE_NULL);
-  g_signal_emit (gve, gve_signals[SIGNAL_PERCENT_COMPLETED], 0, (gfloat) - 1);
+  g_thread_new ("cancel", (GThreadFunc) _set_state_threaded, gve);
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]