minidlna
默认情况下是不支持rmvb
的。为了让其支持rmvb
,需要对其源码进行修改。
源码修改的patch
文件如下:
--- minidlna/metadata.c 2014-08-27 05:09:22.000000000 +0800
+++ minidlna-rmvb/metadata.c 2015-08-29 23:05:58.755575299 +0800
@@ -839,6 +839,10 @@
xasprintf(&m.mime, "video/quicktime");
else if( strncmp(ctx->iformat->name, "matroska", 8) == 0 )
xasprintf(&m.mime, "video/x-matroska");
+ else if( strcmp(ctx->iformat->name, "rm") == 0 )
+ xasprintf(&m.mime, "video/x-pn-realvideo");
+ else if( strcmp(ctx->iformat->name, "rmvb") == 0 )
+ xasprintf(&m.mime, "video/x-pn-realvideo");
else if( strcmp(ctx->iformat->name, "flv") == 0 )
xasprintf(&m.mime, "video/x-flv");
if( m.mime )
--- minidlna/upnpglobalvars.h 2014-08-27 05:09:22.000000000 +0800
+++ minidlna-rmvb/upnpglobalvars.h 2015-08-29 23:06:56.418907372 +0800
@@ -169,6 +169,7 @@
"http-get:*:audio/mp4:*," \
"http-get:*:audio/x-wav:*," \
"http-get:*:audio/x-flac:*," \
+ "http-get:*:video/x-pn-realvideo:*," \
"http-get:*:application/ogg:*"
#define DLNA_FLAG_DLNA_V1_5 0x00100000
--- minidlna/utils.c 2014-08-27 05:09:22.000000000 +0800
+++ minidlna-rmvb/utils.c 2015-08-29 23:07:24.235573449 +0800
@@ -381,6 +381,7 @@
ends_with(file, ".m2t") || ends_with(file, ".mkv") ||
ends_with(file, ".vob") || ends_with(file, ".ts") ||
ends_with(file, ".flv") || ends_with(file, ".xvid") ||
+ ends_with(file, ".rm" ) || ends_with(file, ".rmvb") ||
#ifdef TIVO_SUPPORT
ends_with(file, ".TiVo") ||
#endif
获得该patch
文件使用的命令为:
diff -Nau minidlna/*.c minidlna.rmvb/*.c >> minidlna.patch
使用
patch -s -p0 < minidlna.patch
可应用该patch
。其中minidlna/
表示源码目录。