diff options
author | Jens Georg <mail@jensge.org> | 2016-05-12 22:36:23 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2016-05-12 22:37:14 +0200 |
commit | 7bd00365b4ff26910dcc36953f83002c16c38476 (patch) | |
tree | 15a0fc130418e1e09cce6f31bf363819d2ce1917 /src/librygel-server | |
parent | eb43f2a1595f479120414560ed7ea5c14c236c5a (diff) | |
download | rygel-7bd00365b4ff26910dcc36953f83002c16c38476.tar.gz |
server: Hack for AVI files on recent Phillips TVs
Also needs video/avi as mime type for AVI files.
Signed-off-by: Jens Georg <mail@jensge.org>
Diffstat (limited to 'src/librygel-server')
-rw-r--r-- | src/librygel-server/filelist.am | 1 | ||||
-rw-r--r-- | src/librygel-server/rygel-client-hacks.vala | 4 | ||||
-rw-r--r-- | src/librygel-server/rygel-phillips-hacks.vala | 40 |
3 files changed, 45 insertions, 0 deletions
diff --git a/src/librygel-server/filelist.am b/src/librygel-server/filelist.am index 516e6356..c1b8a27f 100644 --- a/src/librygel-server/filelist.am +++ b/src/librygel-server/filelist.am @@ -81,6 +81,7 @@ LIBRYGEL_SERVER_NONVAPI_SOURCE_FILES = \ rygel-wmp-hacks.vala \ rygel-xbmc-hacks.vala \ rygel-xbox-hacks.vala \ + rygel-phillips-hacks.vala \ rygel-data-sink.vala \ rygel-playspeed.vala \ rygel-playspeed-request.vala \ diff --git a/src/librygel-server/rygel-client-hacks.vala b/src/librygel-server/rygel-client-hacks.vala index abf73dda..709dd572 100644 --- a/src/librygel-server/rygel-client-hacks.vala +++ b/src/librygel-server/rygel-client-hacks.vala @@ -83,6 +83,10 @@ internal abstract class Rygel.ClientHacks : GLib.Object { return new LGTVHacks (message); } catch (Error error) { } + try { + return new PhillipsHacks (message); + } catch (Error error) { } + return new XBMCHacks (message); } diff --git a/src/librygel-server/rygel-phillips-hacks.vala b/src/librygel-server/rygel-phillips-hacks.vala new file mode 100644 index 00000000..2a1984df --- /dev/null +++ b/src/librygel-server/rygel-phillips-hacks.vala @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2016 Jens Georg <mail@jensge.org> + * + * Author: 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.1 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 library; 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.PhillipsHacks : ClientHacks { + private const string AGENT = ".*IPI/.*"; + + public PhillipsHacks (Message? message = null) throws ClientHacksError { + base (AGENT, message); + } + + public override void apply (MediaObject object) { + foreach (var resource in object.get_resource_list ()) { + if (resource.mime_type == "video/x-msvideo") { + resource.mime_type = "video/avi"; + } + } + } +} |