1、下载源代码,目前minidlna最新版本1.2.0, 下载地址sourceforge.net
2、修改源文件
metadata.c
//line 840 else if( strncmp(ctx->iformatctx->name, "matroska", 8) == 0 ) xasprintf(&m.mime, "video/x-matroska"); else if( strcmp(ctx->iformatctx->name, "flv") == 0 ) xasprintf(&m.mime, "video/x-flv"); //----添加---- 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"); //---结束---- if( m.mime ) goto video_nodlna;
upnpglobalvars.h
// Line 169 "http-get:*:audio/mp4:*," \ "http-get:*:audio/x-wav:*," \ "http-get:*:audio/x-flac:*," \ "http-get:*:application/ogg:*," \ //----add---- "http-get:*:video/x-pn-realvideo:*" //----end---- #define DLNA_FLAG_DLNA_V1_5 0x00100000 #define DLNA_FLAG_HTTP_STALLING 0x00200000
utils.c
//line 381 ends_with(file, ".m2t") || ends_with(file, ".mkv") || ends_with(file, ".vob") || ends_with(file, ".ts") || ends_with(file, ".flv") || ends_with(file, ".xvid") || //----add---- ends_with(file, ".rm") || ends_with(file, ".rmvb") || //----end---- #ifdef TIVO_SUPPORT ends_with(file, ".TiVo") || #endif ends_with(file, ".mov") || ends_with(file, ".3gp"));
编译:
sudo apt-get install -y build-essential libexif-dev libjpeg-dev libid3tag0-dev libflac-dev libvorbis-dev libsqlite3-dev libavformat-dev autoconf automake autopoint ./autogen.sh ./configure make make install sudo cp ./linux/minidlna.inot.d.script /etc/init.d/minidlna sudo cp ./minidlna.conf /etc/minidlna.conf # 第一次启动使用-d –v选项看有没有出错 sudo /usr/local/sbin/minidlnad -d -v # 没出错就ctrl+c 结束进程 # 正常启动 sudo service minidlna start # 刷新列表 sudo service minidlna restart
配置文件在/etc/minidlna.conf