diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2013-07-14 18:11:59 +0200 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2013-07-28 13:28:22 +0200 |
commit | d08439e864abc120cff9943abadddfdd20ccee6a (patch) | |
tree | f5827483d0992a0f65b7624bc938b5934aac14e6 | |
parent | 14fb825ab3aad84857833327aeca4fcaa262a02a (diff) |
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
-rw-r--r-- | gst-libs/gst/rtsp/gstrtspconnection.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index 15813bef9..9041a3305 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -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; } |