2 * Copyright (C) 2011 Nokia Corporation.
4 * Author: Jens Georg <jensg@openismus.com>
6 * This file is part of Rygel.
8 * Rygel is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * Rygel is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 internal class Rygel.XBMCHacks : ClientHacks {
27 // FIXME: Limit to known broken versions once this is fixed in XBMC as
28 // promised by developers.
29 private const string AGENT = ".*Platinum/.*|.*XBMC/.*";
31 public XBMCHacks () throws ClientHacksError, RegexError {
35 public XBMCHacks.for_action (ServiceAction action)
36 throws ClientHacksError {
37 unowned MessageHeaders headers = action.get_message ().request_headers;
38 this.for_headers (headers);
41 public XBMCHacks.for_headers (MessageHeaders headers)
42 throws ClientHacksError {
43 base (AGENT, headers);
46 public override void apply (MediaItem item) {
47 if (item.mime_type == "audio/mp4" ||
48 item.mime_type == "audio/3gpp" ||
49 item.mime_type == "audio/vnd.dlna.adts") {
50 item.mime_type = "audio/aac";