mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-30 02:58:24 +00:00
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:
parent
edecd7eec3
commit
c6f8220920
1 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue