You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.8 KiB

  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. metadata.c | 4 ++++
  7. upnpglobalvars.h | 3 ++-
  8. utils.c | 3 +++
  9. 3 files changed, 9 insertions(+), 1 deletion(-)
  10. --- a/metadata.c
  11. +++ b/metadata.c
  12. @@ -862,6 +862,10 @@ GetVideoMetadata(const char *path, const
  13. xasprintf(&m.mime, "video/x-matroska");
  14. else if( strcmp(ctx->iformat->name, "flv") == 0 )
  15. xasprintf(&m.mime, "video/x-flv");
  16. + else if( strcmp(ctx->iformat->name, "rm") == 0 )
  17. + xasprintf(&m.mime, "video/x-pn-realvideo");
  18. + else if( strcmp(ctx->iformat->name, "rmvb") == 0 )
  19. + xasprintf(&m.mime, "video/x-pn-realvideo");
  20. if( m.mime )
  21. goto video_no_dlna;
  22. --- a/upnpglobalvars.h
  23. +++ b/upnpglobalvars.h
  24. @@ -172,7 +172,8 @@
  25. "http-get:*:audio/x-wav:*," \
  26. "http-get:*:audio/x-flac:*," \
  27. "http-get:*:audio/x-dsd:*," \
  28. - "http-get:*:application/ogg:*"
  29. + "http-get:*:application/ogg:*,"\
  30. + "http-get:*:video/x-pn-realvideo:*"
  31. #define DLNA_FLAG_DLNA_V1_5 0x00100000
  32. #define DLNA_FLAG_HTTP_STALLING 0x00200000
  33. --- a/utils.c
  34. +++ b/utils.c
  35. @@ -377,6 +377,8 @@ mime_to_ext(const char * mime)
  36. return "3gp";
  37. else if( strncmp(mime+6, "x-tivo-mpeg", 11) == 0 )
  38. return "TiVo";
  39. + else if( strcmp(mime+6, "x-pn-realvideo") == 0 )
  40. + return "rm";
  41. break;
  42. case 'i':
  43. if( strcmp(mime+6, "jpeg") == 0 )
  44. @@ -401,6 +403,7 @@ is_video(const char * file)
  45. ends_with(file, ".m2t") || ends_with(file, ".mkv") ||
  46. ends_with(file, ".vob") || ends_with(file, ".ts") ||
  47. ends_with(file, ".flv") || ends_with(file, ".xvid") ||
  48. + ends_with(file, ".rm") || ends_with(file, ".rmvb") ||
  49. #ifdef TIVO_SUPPORT
  50. ends_with(file, ".TiVo") ||
  51. #endif