diff options
author | David Schleef <ds@schleef.org> | 2014-09-15 03:39:29 -0700 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2014-09-15 03:42:09 -0700 |
commit | 1fa4145fcf78add8e6396a14e845c0e9ffbf5148 (patch) | |
tree | 980879a6233036ddfebec1aaa8a5ba23e24087a1 | |
parent | 118e6386cf38436b23e861435fe656552f139dc9 (diff) |
connection: start output in idle handler
-rw-r--r-- | rtmp/rtmpconnection.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/rtmp/rtmpconnection.c b/rtmp/rtmpconnection.c index 90c6866..d6a5343 100644 --- a/rtmp/rtmpconnection.c +++ b/rtmp/rtmpconnection.c @@ -271,17 +271,17 @@ gst_rtmp_connection_close (GstRtmpConnection * connection) } -static void -gst_rtmp_connection_start_output (GstRtmpConnection * sc) +static gboolean +start_output (gpointer user_priv) { + GstRtmpConnection *sc = GST_RTMP_CONNECTION (user_priv); GOutputStream *os; if (!sc->handshake_complete) - return; + return G_SOURCE_REMOVE; - /* FIXME needs mutex */ if (sc->output_source) - return; + return G_SOURCE_REMOVE; os = g_io_stream_get_output_stream (G_IO_STREAM (sc->connection)); sc->output_source = @@ -290,6 +290,18 @@ gst_rtmp_connection_start_output (GstRtmpConnection * sc) g_source_set_callback (sc->output_source, (GSourceFunc) gst_rtmp_connection_output_ready, sc, NULL); g_source_attach (sc->output_source, sc->main_context); + + return G_SOURCE_REMOVE; +} + +static void +gst_rtmp_connection_start_output (GstRtmpConnection * sc) +{ + GSource *source; + + source = g_idle_source_new (); + g_source_set_callback (source, start_output, sc, NULL); + g_source_attach (source, sc->main_context); } static gboolean |