rygel r423 - trunk/src/rygel



Author: zeeshanak
Date: Tue Jan 13 14:32:33 2009
New Revision: 423
URL: http://svn.gnome.org/viewvc/rygel?rev=423&view=rev

Log:
Go to PAUSED state first and then PLAYING.

This is to ensure that seek event is sent to pipeline before it goes to
PLAYING state. This could be the solution to mp3 not working on PS3.

Modified:
   trunk/src/rygel/rygel-gst-stream.vala

Modified: trunk/src/rygel/rygel-gst-stream.vala
==============================================================================
--- trunk/src/rygel/rygel-gst-stream.vala	(original)
+++ trunk/src/rygel/rygel-gst-stream.vala	Tue Jan 13 14:32:33 2009
@@ -57,7 +57,8 @@
     }
 
     public void start () {
-        this.set_state (State.PLAYING);
+        // Go to PAUSED first
+        this.set_state (State.PAUSED);
     }
 
     public void stop () {
@@ -209,15 +210,19 @@
 
         if (message.type == MessageType.EOS) {
             ret = false;
-        } else if (message.type == MessageType.STATE_CHANGED &&
-                   this.seek_event != null) {
+        } else if (message.type == MessageType.STATE_CHANGED) {
             State new_state;
 
             message.parse_state_changed (null, out new_state, null);
-            if (new_state == State.PAUSED || new_state == State.PLAYING) {
-                // Time to shove-in the pending seek event
-                this.send_event (this.seek_event);
-                this.seek_event = null;
+            if (new_state == State.PAUSED) {
+                if (this.seek_event != null) {
+                    // Time to shove-in the pending seek event
+                    this.send_event (this.seek_event);
+                    this.seek_event = null;
+                }
+
+                // Now we can proceed to start streaming
+                this.set_state (State.PLAYING);
             }
         } else {
             GLib.Error err;



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