summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-05-05 13:16:57 +0300
committerSebastian Dröge <sebastian@centricular.com>2016-05-05 13:17:53 +0300
commit46e808a300235ce6738e46b8891abd05bb77973c (patch)
tree1721b251241cb1acc403d65f65679dc5582f139e /gst
parentfe4e9bb02cc859715eaac37ca4ee02e3b9e4f76e (diff)
multihandlesink: Warn if trying to change the state from the streaming thread
Instead of silently returning GST_STATE_CHANGE_FAILURE.
Diffstat (limited to 'gst')
-rw-r--r--gst/tcp/gstmultihandlesink.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gst/tcp/gstmultihandlesink.c b/gst/tcp/gstmultihandlesink.c
index d17cd4333..f060f0eaf 100644
--- a/gst/tcp/gstmultihandlesink.c
+++ b/gst/tcp/gstmultihandlesink.c
@@ -2221,9 +2221,16 @@ gst_multi_handle_sink_change_state (GstElement * element,
sink = GST_MULTI_HANDLE_SINK (element);
/* we disallow changing the state from the streaming thread */
- if (g_thread_self () == sink->thread)
- return GST_STATE_CHANGE_FAILURE;
+ if (g_thread_self () == sink->thread) {
+ g_warning
+ ("\nTrying to change %s's state from its streaming thread would deadlock.\n"
+ "You cannot change the state of an element from its streaming\n"
+ "thread. Use g_idle_add() or post a GstMessage on the bus to\n"
+ "schedule the state change from the main thread.\n",
+ GST_ELEMENT_NAME (sink));
+ return GST_STATE_CHANGE_FAILURE;
+ }
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY: