diff options
author | Jakub Adam <jakub.adam@ktknet.cz> | 2014-09-25 15:50:30 +0200 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2015-01-28 22:32:31 -0500 |
commit | 21dd3d1566d9b5e5d31a944b5f15f56fe6e4e596 (patch) | |
tree | 70c35dd9e024d98ede303fcecf25f628ffa55ca2 /gst/gstnicesink.c | |
parent | 7e571b22d5e236d17e3575a8723b5c07f7fa30e4 (diff) | |
download | libnice-21dd3d1566d9b5e5d31a944b5f15f56fe6e4e596.tar.gz |
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.
Diffstat (limited to 'gst/gstnicesink.c')
-rw-r--r-- | gst/gstnicesink.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gst/gstnicesink.c b/gst/gstnicesink.c index 80cca40..a6f099d 100644 --- a/gst/gstnicesink.c +++ b/gst/gstnicesink.c @@ -1,3 +1,4 @@ + /* * 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: |