From: Zeeshan Ali (Khattak) Date: Mon, 18 Jan 2010 16:54:55 +0000 (+0200) Subject: Revert "core: Push data directly from gst thread" X-Git-Tag: RYGEL_0_5_0~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d1c645216ebaca643ad5995802a16e8e4f488d3;p=profile%2Fivi%2Frygel.git Revert "core: Push data directly from gst thread" This reverts commit e5cfcf87fc4bf3f2e82b860ec95388e84f8410f7. Conflicts: src/rygel/rygel-live-response.vala --- diff --git a/src/rygel/rygel-live-response.vala b/src/rygel/rygel-live-response.vala index 7b90f6d..1680e88 100644 --- a/src/rygel/rygel-live-response.vala +++ b/src/rygel/rygel-live-response.vala @@ -38,6 +38,7 @@ internal class Rygel.LiveResponse : Rygel.HTTPResponse { private HTTPSeek time_range; + private uint idle_id; private SourceFunc run_continue; public LiveResponse (Soup.Server server, @@ -70,6 +71,11 @@ internal class Rygel.LiveResponse : Rygel.HTTPResponse { public override void end (bool aborted, uint status) { this.pipeline.set_state (State.NULL); + if (this.idle_id != 0) { + Source.remove (this.idle_id); + this.idle_id = 0; + } + if (!aborted) { this.msg.response_body.complete (); } @@ -152,7 +158,14 @@ internal class Rygel.LiveResponse : Rygel.HTTPResponse { private void on_new_buffer (Element sink, Buffer buffer, Pad pad) { - this.push_data (buffer.data, buffer.size); + this.idle_id = Idle.add_full (Priority.HIGH_IDLE, + () => { + this.push_data (buffer.data, buffer.size); + + this.idle_id = 0; + + return false; + }); } private bool bus_handler (Gst.Bus bus,