[rygel] core: Add MediaItem.streamable()
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Add MediaItem.streamable()
- Date: Fri, 20 Aug 2010 19:57:26 +0000 (UTC)
commit a7d5b6cc6b8e7eabc297a01212bbdc31ec9197e1
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Fri Aug 20 22:36:37 2010 +0300
core: Add MediaItem.streamable()
Differential between items that are streamable and should be streamed.
src/rygel/rygel-http-get.vala | 2 +-
src/rygel/rygel-media-item.vala | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/rygel/rygel-http-get.vala b/src/rygel/rygel-http-get.vala
index 1530c23..b783102 100644
--- a/src/rygel/rygel-http-get.vala
+++ b/src/rygel/rygel-http-get.vala
@@ -130,7 +130,7 @@ internal class Rygel.HTTPGet : HTTPRequest {
switch (mode) {
case "Streaming":
correct = this.handler is HTTPTranscodeHandler ||
- (this.item.should_stream () &&
+ (this.item.streamable () &&
this.subtitle == null &&
this.thumbnail == null);
diff --git a/src/rygel/rygel-media-item.vala b/src/rygel/rygel-media-item.vala
index e1431ac..8fd777e 100644
--- a/src/rygel/rygel-media-item.vala
+++ b/src/rygel/rygel-media-item.vala
@@ -111,9 +111,13 @@ public class Rygel.MediaItem : MediaObject {
// Return true if item should be streamed as a live response with
// time based seeking, or false to serve directly with byte range
// seeking.
- public virtual bool should_stream () {
+ public bool should_stream () {
// Simple heuristic: if size is known and its not image, serve directly.
- return !this.upnp_class.has_prefix (IMAGE_CLASS) && this.size <= 0;
+ return this.streamable () && this.size <= 0;
+ }
+
+ public bool streamable () {
+ return !this.upnp_class.has_prefix (IMAGE_CLASS);
}
// Adds URI to MediaItem. You can either provide the associated thumbnail or
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]