[rygel] core: Add MediaItem.get_protocol_info()
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rygel] core: Add MediaItem.get_protocol_info()
- Date: Wed, 26 Aug 2009 22:11:04 +0000 (UTC)
commit e90f12533b6ad20bb575c896b60e3702365ff450
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Aug 26 23:16:43 2009 +0300
core: Add MediaItem.get_protocol_info()
src/rygel/rygel-media-item.vala | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/src/rygel/rygel-media-item.vala b/src/rygel/rygel-media-item.vala
index 4594878..8d1c59e 100644
--- a/src/rygel/rygel-media-item.vala
+++ b/src/rygel/rygel-media-item.vala
@@ -133,14 +133,22 @@ public class Rygel.MediaItem : MediaObject {
res.color_depth = this.color_depth;
/* Protocol info */
+ res.protocol_info = this.get_protocol_info (uri, protocol);
+
+ return res;
+ }
+
+ internal ProtocolInfo get_protocol_info (string? uri,
+ string? protocol) {
var protocol_info = new ProtocolInfo ();
protocol_info.mime_type = this.mime_type;
protocol_info.dlna_profile = this.dlna_profile;
- if (protocol == null) {
- protocol_info.protocol = this.get_protocol_for_uri (res.uri);
- } else {
+
+ if (protocol != null) {
protocol_info.protocol = protocol;
+ } else if (uri != null) {
+ protocol_info.protocol = this.get_protocol_for_uri (uri);
}
if (this.upnp_class.has_prefix (MediaItem.IMAGE_CLASS)) {
@@ -154,9 +162,7 @@ public class Rygel.MediaItem : MediaObject {
protocol_info.dlna_flags |= DLNAFlags.BACKGROUND_TRANSFER_MODE;
}
- res.protocol_info = protocol_info;
-
- return res;
+ return protocol_info;
}
private string get_protocol_for_uri (string uri) throws Error {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]