Commit aa4b20c1 authored by Jens Georg's avatar Jens Georg Committed by Jens Georg
Browse files

renderer: Fix GetCurrentConnectionInfo's p-i

We need to supply a proper protocol info in GetCurrentConnectionInfo if we
have one. This is even required by UPnP.

(Partially) fixes DLNA CTT 7.3.53.2

https://bugzilla.gnome.org/show_bug.cgi?id=706986
parent 0a312d63
......@@ -64,6 +64,10 @@ public class Rygel.ConnectionManager : Service {
(this.get_current_connection_info_cb);
}
public virtual string get_current_protocol_info () {
return "";
}
private void query_source_protocol_info_cb (Service cm,
string var,
ref Value val) {
......@@ -138,7 +142,7 @@ public class Rygel.ConnectionManager : Service {
this.av_transport_id,
"ProtocolInfo",
typeof (string),
"",
this.get_current_protocol_info (),
"PeerConnectionManager",
typeof (string),
"",
......
......@@ -139,4 +139,33 @@ public interface Rygel.MediaPlayer : GLib.Object {
return double.parse (rational[0]) / double.parse (rational[1]);
}
/// Return the protocol info of the current track's meta-data
public string protocol_info {
owned get {
if (this.metadata == null || this.uri == null) {
return "";
}
// Parse meta-data
var p = new GUPnP.DIDLLiteParser ();
GUPnP.DIDLLiteObject item = null;
p.item_available.connect ( (object) => { item = object; });
try {
p.parse_didl (this.metadata);
} catch (Error error) {
return "";
}
var resources = item.get_resources ();
foreach (var resource in resources) {
if (resource.uri == this.uri) {
return resource.protocol_info.to_string ();
}
}
return "";
}
}
}
......@@ -34,4 +34,11 @@ internal class Rygel.SinkConnectionManager : Rygel.ConnectionManager {
var plugin = this.root_device.resource_factory as MediaRendererPlugin;
this.sink_protocol_info = plugin.get_protocol_info ();
}
public override string get_current_protocol_info () {
var plugin = this.root_device.resource_factory as MediaRendererPlugin;
var player = plugin.get_player ();
return player.protocol_info;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment