rtspconnection: Create a new write GSource after removing it

After removal, a GSource is destroyed and can never be attached
again to a main context. We need to create a new one instead.

https://bugzilla.gnome.org/show_bug.cgi?id=704198
This commit is contained in:
Sebastian Dröge 2013-07-14 18:11:59 +02:00
parent edecd7eec3
commit c6f8220920

View file

@ -2978,6 +2978,16 @@ gst_rtsp_source_dispatch_write (GPollableOutputStream * stream,
if (watch->write_added) {
g_source_remove_child_source ((GSource *) watch, watch->writesrc);
watch->write_added = FALSE;
/* Need to create a new source as once removed/destroyed sources
* can't be attached again later */
g_source_unref (watch->writesrc);
watch->writesrc =
g_pollable_output_stream_create_source (G_POLLABLE_OUTPUT_STREAM
(watch->conn->output_stream), NULL);
g_source_set_callback (watch->writesrc,
(GSourceFunc) gst_rtsp_source_dispatch_write, watch, NULL);
/* we add the write source when we actually have something to write */
}
break;
}