[longomatch] Fix deadlock cancelling rendering jobs
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix deadlock cancelling rendering jobs
- Date: Tue, 28 Oct 2014 09:56:03 +0000 (UTC)
commit a054964bb9920d9fa3bae1e37455f61fcaa073ed
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Mon Oct 27 17:36:07 2014 +0100
Fix deadlock cancelling rendering jobs
libcesarplayer/gst-nle-source.c | 15 +++++++++++++++
libcesarplayer/gst-video-editor.c | 9 +--------
2 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/libcesarplayer/gst-nle-source.c b/libcesarplayer/gst-nle-source.c
index 108cc91..7baa0c5 100644
--- a/libcesarplayer/gst-nle-source.c
+++ b/libcesarplayer/gst-nle-source.c
@@ -684,12 +684,27 @@ gst_nle_source_change_state (GstElement * element, GstStateChange transition)
return res;
switch (transition) {
+ case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
+ if (nlesrc->decoder) {
+ gst_element_set_state (nlesrc->decoder, GST_STATE_PAUSED);
+ }
+ break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
if (nlesrc->decoder) {
+ gst_element_set_state (nlesrc->decoder, GST_STATE_READY);
+ }
+ if (nlesrc->queue != NULL) {
+ g_list_free_full (nlesrc->queue, (GDestroyNotify) gst_nle_source_item_free);
+ nlesrc->queue = NULL;
+ }
+ break;
+ case GST_STATE_CHANGE_READY_TO_NULL:
+ if (nlesrc->decoder) {
gst_element_set_state (nlesrc->decoder, GST_STATE_NULL);
gst_object_unref (nlesrc->decoder);
nlesrc->decoder = NULL;
}
+ break;
default:
break;
}
diff --git a/libcesarplayer/gst-video-editor.c b/libcesarplayer/gst-video-editor.c
index 1c89c0d..1555a94 100644
--- a/libcesarplayer/gst-video-editor.c
+++ b/libcesarplayer/gst-video-editor.c
@@ -610,13 +610,6 @@ 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)
{
@@ -627,7 +620,7 @@ gst_video_editor_cancel (GstVideoEditor * gve)
g_source_remove (gve->priv->update_id);
gve->priv->update_id = 0;
}
- g_thread_new ("cancel", (GThreadFunc) _set_state_threaded, gve);
+ gst_element_set_state (gve->priv->main_pipeline, GST_STATE_NULL);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]