[rygel] core: No need to pass around the protocol string
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: No need to pass around the protocol string
- Date: Wed, 17 Feb 2010 13:39:44 +0000 (UTC)
commit fb4e453b714bb713fd3e38b46cb911fa42f2f15e
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Mon Jan 25 18:18:58 2010 +0200
core: No need to pass around the protocol string
src/rygel/rygel-http-server.vala | 19 +++++--------------
src/rygel/rygel-transcode-manager.vala | 3 +--
src/rygel/rygel-transcoder.vala | 5 ++---
3 files changed, 8 insertions(+), 19 deletions(-)
---
diff --git a/src/rygel/rygel-http-server.vala b/src/rygel/rygel-http-server.vala
index 86276c8..f311cf9 100644
--- a/src/rygel/rygel-http-server.vala
+++ b/src/rygel/rygel-http-server.vala
@@ -67,9 +67,8 @@ internal class Rygel.HTTPServer : Rygel.TranscodeManager, Rygel.StateMachine {
throws Error {
if (!this.http_uri_present (item)) {
// Create the HTTP proxy URI
- string protocol;
- var uri = this.create_uri_for_item (item, -1, null, out protocol);
- item.add_resource (didl_item, uri, protocol);
+ var uri = this.create_uri_for_item (item, -1, null);
+ item.add_resource (didl_item, uri, this.get_protocol ());
}
base.add_resources (didl_item, item);
@@ -79,13 +78,9 @@ internal class Rygel.HTTPServer : Rygel.TranscodeManager, Rygel.StateMachine {
if (!is_http_uri (thumbnail.uri)) {
var uri = thumbnail.uri; // Save the original URI
var index = item.thumbnails.index_of (thumbnail);
- string protocol;
- thumbnail.uri = this.create_uri_for_item (item,
- index,
- null,
- out protocol);
- thumbnail.add_resource (didl_item, protocol);
+ thumbnail.uri = this.create_uri_for_item (item, index, null);
+ thumbnail.add_resource (didl_item, this.get_protocol ());
// Now restore the original URI
thumbnail.uri = uri;
@@ -129,13 +124,9 @@ internal class Rygel.HTTPServer : Rygel.TranscodeManager, Rygel.StateMachine {
internal override string create_uri_for_item (MediaItem item,
int thumbnail_index,
- string? transcode_target,
- out string protocol) {
-
+ string? transcode_target) {
var uri = new HTTPItemURI (item.id, thumbnail_index, transcode_target);
- protocol = "http-get";
-
return create_uri_for_path (uri.to_string());
}
diff --git a/src/rygel/rygel-transcode-manager.vala b/src/rygel/rygel-transcode-manager.vala
index 5bb002e..055a875 100644
--- a/src/rygel/rygel-transcode-manager.vala
+++ b/src/rygel/rygel-transcode-manager.vala
@@ -54,8 +54,7 @@ internal abstract class Rygel.TranscodeManager : GLib.Object {
public abstract string create_uri_for_item (MediaItem item,
int thumbnail_index,
- string? transcode_target,
- out string protocol);
+ string? transcode_target);
public virtual void add_resources (DIDLLiteItem didl_item,
MediaItem item)
diff --git a/src/rygel/rygel-transcoder.vala b/src/rygel/rygel-transcoder.vala
index a130897..16b6ca8 100644
--- a/src/rygel/rygel-transcoder.vala
+++ b/src/rygel/rygel-transcoder.vala
@@ -64,11 +64,10 @@ internal abstract class Rygel.Transcoder : GLib.Object {
return null;
}
- string protocol;
+ var protocol = manager.get_protocol ();
var uri = manager.create_uri_for_item (item,
-1,
- this.dlna_profile,
- out protocol);
+ this.dlna_profile);
var res = item.add_resource (didl_item, uri, protocol);
res.size = -1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]