summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2014-03-12 16:36:27 +0200
committerJens Georg <mail@jensge.org>2015-04-19 15:24:08 +0200
commitc50c21047d53ead8f4b870f256b5af82a169a23e (patch)
tree499dd1abcfbc564cb83c4f8ca3b30556a2351c7e
parent278f83066f25f44f7f3744d4c29c7e7564c7aabd (diff)
downloadrygel-c50c21047d53ead8f4b870f256b5af82a169a23e.tar.gz
lms plugin: add missing fields to video object
-rw-r--r--src/plugins/lms/rygel-lms-all-videos.vala17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/lms/rygel-lms-all-videos.vala b/src/plugins/lms/rygel-lms-all-videos.vala
index 33cb6496..d28cb96c 100644
--- a/src/plugins/lms/rygel-lms-all-videos.vala
+++ b/src/plugins/lms/rygel-lms-all-videos.vala
@@ -76,6 +76,23 @@ public class Rygel.LMS.AllVideos : Rygel.LMS.CategoryContainer {
video.mime_type = mime_type;
video.add_uri (file.get_uri ());
+ // Rygel does not support multiple video and audio tracks in a single file,
+ // so we just take the first one
+ var video_data = "select videos_videos.bitrate + videos_audios.bitrate, width, height, channels, sampling_rate " +
+ "from videos, videos_audios, videos_videos where videos.id = ? " +
+ "and videos.id = videos_audios.video_id and videos.id = videos_videos.video_id;";
+ try {
+ var stmt = this.lms_db.prepare(video_data);
+ Rygel.LMS.Database.find_object("%d".printf(id), stmt);
+ video.bitrate = stmt.column_int(0) / 8; //convert bits per second into bytes per second
+ video.width = stmt.column_int(1);
+ video.height = stmt.column_int(2);
+ video.channels = stmt.column_int(3);
+ video.sample_freq = stmt.column_int(4);
+ } catch (DatabaseError e) {
+ warning ("Query failed: %s", e.message);
+ }
+
return video;
}