[rygel] server: Add LG TV hacks



commit d59cedcbf1da4f9a50d215b03d30b3233a77cfe5
Author: Jens Georg <mail jensge org>
Date:   Tue Dec 31 14:33:53 2013 +0100

    server: Add LG TV hacks
    
    Signed-off-by: Jens Georg <mail jensge org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=721270

 src/librygel-server/filelist.am             |    1 +
 src/librygel-server/rygel-client-hacks.vala |    3 ++
 src/librygel-server/rygel-lg-tv-hacks.vala  |   44 +++++++++++++++++++++++++++
 3 files changed, 48 insertions(+), 0 deletions(-)
---
diff --git a/src/librygel-server/filelist.am b/src/librygel-server/filelist.am
index fcc0bbc..4b2279f 100644
--- a/src/librygel-server/filelist.am
+++ b/src/librygel-server/filelist.am
@@ -62,6 +62,7 @@ LIBRYGEL_SERVER_NONVAPI_SOURCE_FILES = \
        rygel-last-change-obj-mod.vala \
        rygel-last-change-st-done.vala \
        rygel-last-change.vala \
+       rygel-lg-tv-hacks.vala \
        rygel-m3u-playlist.vala \
        rygel-media-query-action.vala \
        rygel-media-receiver-registrar.vala \
diff --git a/src/librygel-server/rygel-client-hacks.vala b/src/librygel-server/rygel-client-hacks.vala
index 291d9fa..8bb9927 100644
--- a/src/librygel-server/rygel-client-hacks.vala
+++ b/src/librygel-server/rygel-client-hacks.vala
@@ -79,6 +79,9 @@ internal abstract class Rygel.ClientHacks : GLib.Object {
             return new SeekHacks (message);
         } catch (Error error) { }
 
+        try {
+            return new LGTVHacks (message);
+        } catch (Error error) { }
 
         return new XBMCHacks (message);
     }
diff --git a/src/librygel-server/rygel-lg-tv-hacks.vala b/src/librygel-server/rygel-lg-tv-hacks.vala
new file mode 100644
index 0000000..a24ed65
--- /dev/null
+++ b/src/librygel-server/rygel-lg-tv-hacks.vala
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2014 Jens Georg
+ *
+ * Authors: Jens Georg <mail jensge org>
+ *
+ * This file is part of Rygel.
+ *
+ * Rygel is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using Soup;
+using GUPnP;
+
+internal class Rygel.LGTVHacks : ClientHacks {
+    private const string AGENT = ".*LGE_DLNA_SDK.*";
+
+    public LGTVHacks (Message? message = null) throws ClientHacksError {
+        base (AGENT, message);
+    }
+
+    public override void apply (MediaObject object) {
+        if (!(object is MediaItem)) {
+            return;
+        }
+
+        var item = object as MediaItem;
+        if (item.mime_type == "audio/x-vorbis+ogg" ||
+            item.mime_type == "audio/x-flac+ogg") {
+            item.mime_type = "application/ogg";
+        }
+    }
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]