]> git.sesse.net Git - vlc/blobdiff - modules/demux/vobsub.c
Added strnlen replacement (Untested)
[vlc] / modules / demux / vobsub.c
index 032e535a2c4e0daaa925d724163fb46bedef2bb9..e5ebdb2e47cfc9d7bfa3e2c7fb44a331a08c07ee 100644 (file)
@@ -32,9 +32,8 @@
 #include <errno.h>
 #include <sys/types.h>
 
-#include <vlc/input.h>
-#include "vlc_video.h"
-#include "charset.h"
+#include <vlc_demux.h>
+#include <vlc_charset.h>
 
 #include "ps.h"
 
@@ -180,9 +179,9 @@ static int Open ( vlc_object_t *p_this )
         }
     }
 
-    psz_vobname = strdup( p_demux->psz_path );
+    asprintf( &psz_vobname, "%s://%s", p_demux->psz_access, p_demux->psz_path );
     i_len = strlen( psz_vobname );
-    memcpy( psz_vobname + i_len - 4, ".sub", 4 );
+    if( i_len >= 4 ) memcpy( psz_vobname + i_len - 4, ".sub", 4 );
 
     /* open file */
     p_sys->p_vobsub_stream = stream_UrlNew( p_demux, psz_vobname );