Commit 21dd3d15 authored by Jakub Adam's avatar Jakub Adam Committed by Olivier Crête
Browse files

nicesink: unblock pending write on component change

When a nicesink switches to a different component, we should unblock any
pending write waiting in gst_nice_sink_render() for writable_cond being
signalled because if the new transport already is writable, we'll never
get notified about the condition and thus nicesink will wait forever.

That way, either the pending data are immediately sent or the nicesink
blocks again until the transport becomes writable.
parent 7e571b22
/*
* This file is part of the Nice GLib ICE library.
*
......@@ -301,9 +302,15 @@ gst_nice_sink_set_property (
break;
case PROP_COMPONENT:
GST_OBJECT_LOCK (sink);
sink->component_id = g_value_get_uint (value);
GST_OBJECT_UNLOCK (sink);
{
guint new_component_id = g_value_get_uint (value);
GST_OBJECT_LOCK (sink);
if (sink->component_id != new_component_id) {
sink->component_id = new_component_id;
g_cond_broadcast (&sink->writable_cond);
}
GST_OBJECT_UNLOCK (sink);
}
break;
default:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment