[rygel/wip/m3u] WIP



commit 216f8a3c0d3e962701be98e840b36f2c21c7ded4
Author: Jens Georg <mail jensge org>
Date:   Sun Dec 9 22:00:13 2012 +0100

    WIP

 .../rygel-playbin-player.vala                      |    2 ++
 src/librygel-renderer/rygel-av-transport.vala      |   18 +++++++++---------
 src/librygel-renderer/rygel-player-controller.vala |    3 ++-
 3 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/src/librygel-renderer-gst/rygel-playbin-player.vala 
b/src/librygel-renderer-gst/rygel-playbin-player.vala
index 129a4c1..7691d43 100644
--- a/src/librygel-renderer-gst/rygel-playbin-player.vala
+++ b/src/librygel-renderer-gst/rygel-playbin-player.vala
@@ -508,7 +508,9 @@ public class Rygel.Playbin.Player : GLib.Object, Rygel.MediaPlayer {
                               Message message) {
         switch (message.type) {
         case MessageType.DURATION_CHANGED:
+            debug ("====> DURATION HINT");
             if (this.playbin.query_duration (Format.TIME, null)) {
+                debug ("=====> DURATION TIME HINT");
                 this.notify_property ("duration");
             }
         break;
diff --git a/src/librygel-renderer/rygel-av-transport.vala b/src/librygel-renderer/rygel-av-transport.vala
index dd11151..df0fbaa 100644
--- a/src/librygel-renderer/rygel-av-transport.vala
+++ b/src/librygel-renderer/rygel-av-transport.vala
@@ -342,10 +342,12 @@ internal class Rygel.AVTransport : Service {
         }
     }
 
-    private bool is_playlist (string mime, string? features) {
-        return (mime == "text/xml" &&
+    private bool is_playlist (string? mime, string? features) {
+        return (mime != null && mime == "text/xml" &&
+                features != null &&
                 features.has_prefix ("DLNA.ORG_PN=DIDL_S")) ||
-                mime == "audio/mpegurl";
+                mime == "audio/mpegurl" ||
+                mime == "audio/x-mpegurl";
     }
 
     private bool is_valid_mime_type (string? mime) {
@@ -792,7 +794,8 @@ internal class Rygel.AVTransport : Service {
         var content_type = message.response_headers.get_content_type (null);
 
         MediaCollection collection = null;
-        if (content_type == "audio/mpegurl") {
+        if (content_type == "audio/mpegurl" ||
+            content_type == "audio/x-mpegurl") {
             collection = new MediaCollection ();
             var m_stream = new MemoryInputStream.from_data
                                         (message.response_body.data, null);
@@ -812,6 +815,8 @@ internal class Rygel.AVTransport : Service {
                     debug ("Adding uri with %s", line);
                     var item = collection.add_item ();
                     var resource = item.add_resource ();
+                    var pi = new ProtocolInfo.from_string ("*:*:*:*");
+                    resource.set_protocol_info (pi);
                     resource.uri = line;
 
                     line = stream.read_line (out length);
@@ -844,9 +849,4 @@ internal class Rygel.AVTransport : Service {
 
         return result;
     }
-
-    private bool is_playlist (string? mime, string? features) {
-        return mime == "text/xml" && features != null &&
-               features.has_prefix ("DLNA.ORG_PN=DIDL_S");
-    }
 }
diff --git a/src/librygel-renderer/rygel-player-controller.vala 
b/src/librygel-renderer/rygel-player-controller.vala
index 0d91640..1d63610 100644
--- a/src/librygel-renderer/rygel-player-controller.vala
+++ b/src/librygel-renderer/rygel-player-controller.vala
@@ -228,7 +228,8 @@ internal class Rygel.PlayerController : Object {
             this.player.metadata = DIDL_FRAME_TEMPLATE.printf
                                         (item.get_xml_string ());
             this.player.uri = res.get_uri ();
-            if (item.upnp_class.has_prefix ("object.item.image") &&
+            if (item.upnp_class != null &&
+                item.upnp_class.has_prefix ("object.item.image") &&
                 this.collection != null &&
                 this.player.playback_state != "STOPPED") {
                 this.setup_image_timeouts (item.lifetime);


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