mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
multihandlesink: Warn if trying to change the state from the streaming thread
Instead of silently returning GST_STATE_CHANGE_FAILURE.
This commit is contained in:
parent
fe4e9bb02c
commit
46e808a300
1 changed files with 9 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue