gmediaserver-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gmediaserver-devel] patches to make gmediaserver working with my ps3


From: Dmitry Samersoff
Subject: [gmediaserver-devel] patches to make gmediaserver working with my ps3
Date: Sat, 17 Oct 2009 17:41:45 +0400
User-agent: Thunderbird 2.0.0.23 (X11/20090812)

Hi Everybody,

I had some problems compiling and playing *.avi files on my ps3
(server is gmediaserver-0.13.0 on FreeBSD 7.1)

Here is patches that solves these problems.

Patch description:
1. Patch for main.c solves compilation problem in case
   you don't have iconv library.
  (added missed #ifdef HAVE_ICONV brackets)

2. Patch for metadata.c
   I didn't clean up the patch - so please consider it as a rough
   ideas of what I did to make gmediaserver working with ps3.
   Hope someone more familiar with the code could do it better.

 a)  Defaults changed from DLNA.ORG_OP=00 to DLNA.ORG_OP=01
      (required for ps3 to browse content)
 b)  DLNA.ORG_PN for FILE_RIFF_WAVE set to LPCM
 c)  added mapping from x-msvideo to video/divx  - not sure
     I did it right way but it's work
 d) Added #ifdef RESTRICT_FILE_TYPES bracket, may be it's better to
    add command line options.
 e) some changes in debug output

-Dmitry

PS: As far as the project seems to be orphaned for two years - I make a fork with these patches.
See: http://www.beastsoft.net/cgi-bin/hg/hgwebdir.cgi/gmediaserver/

--
Dmitry Samersoff
address@hidden, http://devnull.samersoff.net
* There will come soft rains ...

--- gmediaserver-0.13.0/src/main.c_orig 2009-10-17 13:23:33.000000000 +0400
+++ gmediaserver-0.13.0/src/main.c      2009-10-17 13:23:51.000000000 +0400
@@ -100,6 +100,7 @@
 char *
 convert_string_to_device(const char *str)
 {
+#ifdef HAVE_ICONV
     char *out;
     if (utf8_to_device == (iconv_t) -1)
         return xstrdup(str);
@@ -107,6 +108,7 @@
     if (out != NULL)
         return out;
     warn(_("%s: cannot convert to device character set: %s\n"), quotearg(str), 
errstr);
+#endif 
     return xstrdup(str);
 }
 
@@ -114,13 +116,14 @@
 convert_string_to_log(const char *str)
 {
     char *out;
-
+#ifdef HAVE_ICONV
     if (utf8_to_log == (iconv_t) -1)
         return xstrdup(str);
     out = str_cd_iconv(str, utf8_to_log);
     if (out != NULL)
         return out;
     /* Cannot warn here - would deadlock! */
+#endif 
     return xstrdup(str);
 }
 
@@ -130,6 +133,7 @@
 conv_filename(const char *str)
 {
     free(cache_fs_str);
+#ifdef HAVE_ICONV
     if (fs_to_utf8 == (iconv_t) -1) {
         cache_fs_str = xstrdup(str);
     } else {
@@ -139,6 +143,9 @@
             cache_fs_str = xstrdup(str);
         }
     }
+#else
+    cache_fs_str = xstrdup(str);
+#endif    
     return cache_fs_str;
 }
 
--- gmediaserver-0.13.0/src/metadata.c_orig     2009-10-17 13:39:46.000000000 
+0400
+++ gmediaserver-0.13.0/src/metadata.c  2009-10-17 16:59:33.000000000 +0400
@@ -66,7 +66,7 @@
 #define MAX_INVALID_EXTM3U_FILES       16
 #define MAX_INVALID_PLS_FILES          16
 #define MAX_INVALID_PLS_LINES          16
-#define EXT_INFO_DEFAULT               
"DLNA.ORG_PS=1;DLNA.ORG_CI=0;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00000000000000000000000000000000"
+#define EXT_INFO_DEFAULT               
"DLNA.ORG_PS=1;DLNA.ORG_CI=0;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=00000000000000000000000000000000"
 #define EXT_INFO_PN                    ";DLNA.ORG_PN="
 
 typedef enum {
@@ -109,7 +109,7 @@
     [FILE_MP3]                 = "MP3",
     [FILE_MP3_ID3]     = "MP3",
     [FILE_WMA]                 = "WMAFULL",
-    [FILE_RIFF_WAVE]   = NULL,
+    [FILE_RIFF_WAVE]   = "LPCM",
     [FILE_M4A]                 = NULL,
     [FILE_OGG]         = NULL,
     [FILE_MPG]                 = NULL,
@@ -129,11 +129,11 @@
     [FILE_MP3]                 = "audio/mpeg",
     [FILE_MP3_ID3]     = "audio/mpeg",
     [FILE_WMA]                 = "audio/x-ms-wma",
-    [FILE_RIFF_WAVE]   = "audio/x-wav",
+    [FILE_RIFF_WAVE]   = "audio/x-wav", /* DMS: was x-wav */
     [FILE_M4A]                 = "audio/mp4",
     [FILE_OGG]         = "audio/vorbis",
     [FILE_MPG]                 = "video/mpeg",
-    [FILE_MP4]                 = "video/mp4",
+    [FILE_MP4]                 = "video/divx", /* DMS: was mp4*/
     [FILE_PLS]                 = "audio/x-scpls",
     [FILE_M3U]                 = "audio/m3u",
     [FILE_EXTM3U]      = "audio/m3u",
@@ -153,7 +153,7 @@
     [FILE_M4A]                 = "m4a",
     [FILE_OGG]         = "ogg",
     [FILE_MPG]                 = "mpg",
-    [FILE_MP4]                 = "mp4",
+    [FILE_MP4]                 = "divx", /*DMS: was mp4*/
     [FILE_PLS]                 = "pls",
     [FILE_M3U]                 = "m3u",
     [FILE_EXTM3U]      = "m3u", /* possibly extm3u in the future */
@@ -325,6 +325,8 @@
        return FILE_UNKNOWN;
     }
 
+    say(4, _("Got magic for %s '%s'\n"), quote(conv_filename(fullpath)), 
magic);
+
     if (strcmp(magic, "application/octet-stream") != 0
            && strncmp(magic, "text/plain", 10) != 0) {
        struct {
@@ -341,6 +343,7 @@
            { FILE_MPG,         "video/mp2p" },
            { FILE_MPG,         "video/mp2t" },
            { FILE_MP4,         "video/mp4" },
+           { FILE_MP4,         "video/x-msvideo" }, /* DMS: avi */
            { FILE_MP4,         "video/mp4v-es" },
            { FILE_MP4,         "video/h264" },
            { FILE_MP4,         "video/3gpp" },
@@ -862,18 +865,21 @@
         } else {
            say(4, _("%s  Matched type %s - %s\n"), indent, 
file_type_descs[type], file_type_mime_types[type]);
         }
+
+#ifdef RESTRICT_FILE_TYPES        
        if (!string_in_csv(file_types, ',', file_type_names[type])) {
            say(4, _("%s  Skipping (file type excluded)\n"), indent);
            free(indent);
            return NULL;
        }
+#endif        
 
         if (type == FILE_PLS || type == FILE_M3U || type == FILE_EXTM3U) {
             free(indent);
            return scan_playlist_file(fullpath, name, parent, type, 
indent_size+1, inl, sb.st_ino);
        }
 
-        /*say(4, _("%s  Adding as %s\n"), indent, quote(name));*/
+        say(4, _("%s  Adding %s as '%s'\n"), indent, quote(name), 
file_type_mime_types[type]);
         entry = make_entry(name, parent, false);
 
         detail = add_entry_detail(entry, DETAIL_FILE);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]