minidlna: Added support RMVB
authorVision Lsm <vision.lsm.2012@gmail.com>
Sat, 1 Feb 2020 04:08:45 +0000 (12:08 +0800)
committerVision Lsm <vision.lsm.2012@gmail.com>
Sat, 1 Feb 2020 05:04:19 +0000 (13:04 +0800)
Signed-off-by: Vision Lsm <vision.lsm.2012@gmail.com>
multimedia/minidlna/Makefile
multimedia/minidlna/patches/005-added-support-RMVB.patch [new file with mode: 0644]

index 1e1a143aed58e8aa9b9ff029aff23ef3618c8a75..d6bc34fe64f96829af5db1b5351e61a920be8265 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=minidlna
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://git.code.sf.net/p/minidlna/git
diff --git a/multimedia/minidlna/patches/005-added-support-RMVB.patch b/multimedia/minidlna/patches/005-added-support-RMVB.patch
new file mode 100644 (file)
index 0000000..86f6505
--- /dev/null
@@ -0,0 +1,64 @@
+From e4a045e92b864dc148ca46be94668c5b67132405 Mon Sep 17 00:00:00 2001
+From: VergLsm <vision.lsm.2012@gmail.com>
+Date: Fri, 31 Jan 2020 10:01:12 +0000
+Subject: [PATCH] Added support RMVB.
+
+---
+ metadata.c       | 4 ++++
+ upnpglobalvars.h | 3 ++-
+ utils.c          | 3 +++
+ 3 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/metadata.c b/metadata.c
+index 9cd86dc..2d13480 100644
+--- a/metadata.c
++++ b/metadata.c
+@@ -862,6 +862,10 @@ GetVideoMetadata(const char *path, const char *name)
+                       xasprintf(&m.mime, "video/x-matroska");
+               else if( strcmp(ctx->iformat->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_no_dlna;
+diff --git a/upnpglobalvars.h b/upnpglobalvars.h
+index 1a2fb5e..2cbe24c 100644
+--- a/upnpglobalvars.h
++++ b/upnpglobalvars.h
+@@ -172,7 +172,8 @@
+       "http-get:*:audio/x-wav:*," \
+       "http-get:*:audio/x-flac:*," \
+       "http-get:*:audio/x-dsd:*," \
+-      "http-get:*:application/ogg:*"
++      "http-get:*:application/ogg:*,"\
++      "http-get:*:video/x-pn-realvideo:*"
+ #define DLNA_FLAG_DLNA_V1_5      0x00100000
+ #define DLNA_FLAG_HTTP_STALLING  0x00200000
+diff --git a/utils.c b/utils.c
+index dc936f9..006f611 100644
+--- a/utils.c
++++ b/utils.c
+@@ -377,6 +377,8 @@ mime_to_ext(const char * mime)
+                               return "3gp";
+                       else if( strncmp(mime+6, "x-tivo-mpeg", 11) == 0 )
+                               return "TiVo";
++                      else if( strcmp(mime+6, "x-pn-realvideo") == 0 )
++                              return "rm";
+                       break;
+               case 'i':
+                       if( strcmp(mime+6, "jpeg") == 0 )
+@@ -401,6 +403,7 @@ is_video(const char * file)
+               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
+-- 
+2.20.1
+