--- Begin Message ---
Package: gmediaserver
Version: 0.13.0-7
Severity: wishlist
Hi,
attached patch adds support for matroska media containers. Since
libmagic doesn't output a mime type for matroska containers you still
need to set:
0 belong 0x1a45dfa3 EBML file
!:mime video/x-matroska
>4 search/b/100 \102\202
>>&1 string x \b, creator %.8s
in /etc/magic but then it will happily work with mkv. I'll file a bug
against libmagic to get the mime type included.
Cheers,
-- Guido
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
>From bd9e13c48a1cbf19839166d98c3d9cb8811992f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <[email protected]>
Date: Sat, 18 Feb 2012 16:12:07 +0100
Subject: [PATCH] Add support for Matrosca Media Container
---
src/metadata.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/src/metadata.c b/src/metadata.c
index 44680e3..5e4ca1b 100644
--- a/src/metadata.c
+++ b/src/metadata.c
@@ -59,7 +59,7 @@
#include "gmediaserver.h"
#define DEFAULT_ENTRIES_SIZE 512
-#define DEFAULT_FILE_TYPES "mp3,wma,m3u,pls"
+#define DEFAULT_FILE_TYPES "mp3,wma,m3u,pls,mkv"
#define ROOT_ENTRY_NAME "(root)"
#define DEFAULT_PLAYLIST_ENTRIES 16
#define MAX_INVALID_M3U_FILES 16
@@ -78,6 +78,7 @@ typedef enum {
FILE_OGG,
FILE_MPG,
FILE_MP4,
+ FILE_MKV,
FILE_PLS,
FILE_M3U,
FILE_EXTM3U,
@@ -114,6 +115,7 @@ static const char *file_type_dlna_pn[] = {
[FILE_OGG] = NULL,
[FILE_MPG] = NULL,
[FILE_MP4] = NULL,
+ [FILE_MKV] = NULL,
[FILE_PLS] = NULL,
[FILE_M3U] = NULL,
[FILE_EXTM3U] = NULL,
@@ -134,6 +136,7 @@ static const char *file_type_mime_types[] = {
[FILE_OGG] = "audio/vorbis",
[FILE_MPG] = "video/mpeg",
[FILE_MP4] = "video/mp4",
+ [FILE_MKV] = "video/x-matroska",
[FILE_PLS] = "audio/x-scpls",
[FILE_M3U] = "audio/m3u",
[FILE_EXTM3U] = "audio/m3u",
@@ -154,6 +157,7 @@ static const char *file_type_names[] = {
[FILE_OGG] = "ogg",
[FILE_MPG] = "mpg",
[FILE_MP4] = "mp4",
+ [FILE_MKV] = "mkv",
[FILE_PLS] = "pls",
[FILE_M3U] = "m3u",
[FILE_EXTM3U] = "m3u", /* possibly extm3u in the future */
@@ -175,6 +179,7 @@ static const char *file_type_descs[] = {
[FILE_OGG] = "Ogg Vorbis audio",
[FILE_MPG] = "MPEG v1/2 Video (MPG)",
[FILE_MP4] = "MPEG v4 Video (MP4)",
+ [FILE_MKV] = "Matroska Media Container (MKV)",
[FILE_PLS] = "PLS playlist",
[FILE_M3U] = "Simple M3U playlist",
[FILE_EXTM3U] = "Extended M3U playlist",
@@ -194,6 +199,7 @@ static ItemClass file_type_item_classes[] = {
[FILE_OGG] = ITEM_AUDIO,
[FILE_MPG] = ITEM_VIDEO,
[FILE_MP4] = ITEM_VIDEO,
+ [FILE_MKV] = ITEM_VIDEO,
[FILE_PLS] = ITEM_PLAYLIST,
[FILE_M3U] = ITEM_PLAYLIST,
[FILE_EXTM3U] = ITEM_PLAYLIST,
@@ -344,6 +350,7 @@ check_file_content_type(const char *fullpath)
{ FILE_MP4, "video/mp4v-es" },
{ FILE_MP4, "video/h264" },
{ FILE_MP4, "video/3gpp" },
+ { FILE_MKV, "video/x-matroska" },
{ FILE_BMP, "image/bmp" },
{ FILE_GIF, "image/gif" },
{ FILE_JPG, "image/jpeg" },
--
1.7.9
--- End Message ---