[rygel] Revert "core: Push data directly from gst thread"



commit 8d1c645216ebaca643ad5995802a16e8e4f488d3
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Jan 18 18:54:55 2010 +0200

    Revert "core: Push data directly from gst thread"
    
    This reverts commit e5cfcf87fc4bf3f2e82b860ec95388e84f8410f7.
    
    Conflicts:
    
    	src/rygel/rygel-live-response.vala

 src/rygel/rygel-live-response.vala |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]