]> git.sesse.net Git - vlc/blobdiff - modules/codec/spudec/spudec.c
* now 0.6.0-cvs
[vlc] / modules / codec / spudec / spudec.c
index 404717aca5409c80a54bdd2614029d7a61dba750..1eae73bf4e2e588abed80b7bdcadfe88e0cc4910 100644 (file)
@@ -2,7 +2,7 @@
  * spudec.c : SPU decoder thread
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: spudec.c,v 1.14 2003/01/30 16:36:04 gbazin Exp $
+ * $Id: spudec.c,v 1.18 2003/05/15 22:27:37 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -45,7 +45,7 @@ static vout_thread_t *FindVout( spudec_thread_t * );
 /*****************************************************************************
  * Module descriptor.
  *****************************************************************************/
-#define FONT_TEXT N_("font used by the text subtitler")
+#define FONT_TEXT N_("Font used by the text subtitler")
 #define FONT_LONGTEXT N_(\
     "When the subtitles are coded in text form then, you can choose " \
     "which font will be used to display them.")
@@ -53,15 +53,16 @@ static vout_thread_t *FindVout( spudec_thread_t * );
 #define DEFAULT_FONT "font-eutopiabold36.rle"
 
 vlc_module_begin();
-    add_category_hint( N_("subtitles"), NULL );
-#if defined(SYS_DARWIN) || defined(SYS_BEOS)
+    add_category_hint( N_("subtitles"), NULL, VLC_TRUE );
+#if defined(SYS_DARWIN) || defined(SYS_BEOS) \
+     || (defined(WIN32) && !defined(UNDER_CE))
     add_file( "spudec-font", NULL, NULL,
-              FONT_TEXT, FONT_LONGTEXT );
+              FONT_TEXT, FONT_LONGTEXT, VLC_TRUE );
 #else
-    add_file( "spudec-font", "./share/" DEFAULT_FONT, NULL,
-              FONT_TEXT, FONT_LONGTEXT );
+    add_file( "spudec-font", "share/" DEFAULT_FONT, NULL,
+              FONT_TEXT, FONT_LONGTEXT, VLC_TRUE );
 #endif
-    set_description( _("subtitles decoder module") );
+    set_description( _("subtitles decoder") );
     set_capability( "decoder", 50 );
     set_callbacks( OpenDecoder, NULL );
 vlc_module_end();
@@ -135,6 +136,14 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
                                 + strlen(DEFAULT_FONT) + 1 );
             sprintf(psz_font, "%s/share/" DEFAULT_FONT, psz_vlcpath);
         }
+#elif defined(WIN32) && !defined(UNDER_CE)
+        if ( (psz_font = config_GetPsz( p_fifo, "spudec-font" )) == NULL )
+        {
+            char * psz_vlcpath = p_fifo->p_libvlc->psz_vlcpath;
+            psz_font = malloc( strlen(psz_vlcpath) + strlen("\\share\\")
+                                + strlen(DEFAULT_FONT) + 1 );
+            sprintf(psz_font, "%s\\share\\" DEFAULT_FONT, psz_vlcpath);
+        }
 #else
         if( (psz_font = config_GetPsz( p_fifo, "spudec-font" )) == NULL )
         {