]> git.sesse.net Git - vlc/blobdiff - modules/demux/subtitle.c
Don't include config.h from the headers - refs #297.
[vlc] / modules / demux / subtitle.c
index 94010042fa4dfec81653496ea02a1de8d6e35360..44fd7ce05d4213159d0c39005a2e30b165241627 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 #include <vlc_input.h>
 
@@ -176,13 +180,12 @@ static int Open ( vlc_object_t *p_this )
     demux_t        *p_demux = (demux_t*)p_this;
     demux_sys_t    *p_sys;
     es_format_t    fmt;
-    input_thread_t *p_input;
     float          f_fps;
     char           *psz_type;
     int  (*pf_read)( demux_t *, subtitle_t* );
     int            i, i_max;
 
-    if( strcmp( p_demux->psz_demux, "subtitle" ) )
+    if( !p_demux->b_force )
     {
         msg_Dbg( p_demux, "subtitle demux discarded" );
         return VLC_EGENERIC;
@@ -198,16 +201,11 @@ static int Open ( vlc_object_t *p_this )
     p_sys->i_microsecperframe = 40000;
 
     /* Get the FPS */
-    p_input = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );
-    if( p_input )
-    {
-        f_fps = var_GetFloat( p_input, "sub-original-fps" );
-        if( f_fps >= 1.0 )
-            p_sys->i_microsecperframe = (int64_t)( (float)1000000 / f_fps );
+    f_fps = var_CreateGetFloat( p_demux, "sub-original-fps" );
+    if( f_fps >= 1.0 )
+        p_sys->i_microsecperframe = (int64_t)( (float)1000000 / f_fps );
 
-        msg_Dbg( p_demux, "Movie fps: %f", f_fps );
-        vlc_object_release( p_input );
-    }
+    msg_Dbg( p_demux, "Movie fps: %f", f_fps );
 
     /* Check for override of the fps */
     f_fps = var_CreateGetFloat( p_demux, "sub-fps" );
@@ -514,10 +512,11 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         case DEMUX_GET_META:
         case DEMUX_GET_ATTACHMENTS:
         case DEMUX_GET_TITLE_INFO:
+        case DEMUX_HAS_UNSUPPORTED_META:
             return VLC_EGENERIC;
 
         default:
-            msg_Err( p_demux, "unknown query in subtitle control" );
+            msg_Err( p_demux, "unknown query %d in subtitle control", i_query );
             return VLC_EGENERIC;
     }
 }
@@ -833,7 +832,7 @@ static int ParseSubRipSubViewer( demux_t *p_demux, subtitle_t *p_subtitle,
         if( b_replace_br )
         {
             char *p;
-            
             while( ( p = strstr( psz_text, "[br]" ) ) )
             {
                 *p++ = '\n';