| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | From e4a045e92b864dc148ca46be94668c5b67132405 Mon Sep 17 00:00:00 2001 | 
|  | 2 | From: VergLsm <vision.lsm.2012@gmail.com> | 
|  | 3 | Date: Fri, 31 Jan 2020 10:01:12 +0000 | 
|  | 4 | Subject: [PATCH] Added support RMVB. | 
|  | 5 |  | 
|  | 6 | --- | 
|  | 7 | metadata.c       | 4 ++++ | 
|  | 8 | upnpglobalvars.h | 3 ++- | 
|  | 9 | utils.c          | 3 +++ | 
|  | 10 | 3 files changed, 9 insertions(+), 1 deletion(-) | 
|  | 11 |  | 
|  | 12 | --- a/metadata.c | 
|  | 13 | +++ b/metadata.c | 
|  | 14 | @@ -862,6 +862,10 @@ GetVideoMetadata(const char *path, const | 
|  | 15 | xasprintf(&m.mime, "video/x-matroska"); | 
|  | 16 | else if( strcmp(ctx->iformat->name, "flv") == 0 ) | 
|  | 17 | xasprintf(&m.mime, "video/x-flv"); | 
|  | 18 | +		else if( strcmp(ctx->iformat->name, "rm") == 0 ) | 
|  | 19 | +			xasprintf(&m.mime, "video/x-pn-realvideo"); | 
|  | 20 | +		else if( strcmp(ctx->iformat->name, "rmvb") == 0 ) | 
|  | 21 | +			xasprintf(&m.mime, "video/x-pn-realvideo"); | 
|  | 22 | if( m.mime ) | 
|  | 23 | goto video_no_dlna; | 
|  | 24 |  | 
|  | 25 | --- a/upnpglobalvars.h | 
|  | 26 | +++ b/upnpglobalvars.h | 
|  | 27 | @@ -172,7 +172,8 @@ | 
|  | 28 | "http-get:*:audio/x-wav:*," \ | 
|  | 29 | "http-get:*:audio/x-flac:*," \ | 
|  | 30 | "http-get:*:audio/x-dsd:*," \ | 
|  | 31 | -	"http-get:*:application/ogg:*" | 
|  | 32 | +	"http-get:*:application/ogg:*,"\ | 
|  | 33 | +	"http-get:*:video/x-pn-realvideo:*" | 
|  | 34 |  | 
|  | 35 | #define DLNA_FLAG_DLNA_V1_5      0x00100000 | 
|  | 36 | #define DLNA_FLAG_HTTP_STALLING  0x00200000 | 
|  | 37 | --- a/utils.c | 
|  | 38 | +++ b/utils.c | 
|  | 39 | @@ -377,6 +377,8 @@ mime_to_ext(const char * mime) | 
|  | 40 | return "3gp"; | 
|  | 41 | else if( strncmp(mime+6, "x-tivo-mpeg", 11) == 0 ) | 
|  | 42 | return "TiVo"; | 
|  | 43 | +			else if( strcmp(mime+6, "x-pn-realvideo") == 0 ) | 
|  | 44 | +				return "rm"; | 
|  | 45 | break; | 
|  | 46 | case 'i': | 
|  | 47 | if( strcmp(mime+6, "jpeg") == 0 ) | 
|  | 48 | @@ -401,6 +403,7 @@ is_video(const char * file) | 
|  | 49 | ends_with(file, ".m2t") || ends_with(file, ".mkv")   || | 
|  | 50 | ends_with(file, ".vob") || ends_with(file, ".ts")    || | 
|  | 51 | ends_with(file, ".flv") || ends_with(file, ".xvid")  || | 
|  | 52 | +		ends_with(file, ".rm") || ends_with(file, ".rmvb")  || | 
|  | 53 | #ifdef TIVO_SUPPORT | 
|  | 54 | ends_with(file, ".TiVo") || | 
|  | 55 | #endif |