]> git.sesse.net Git - vlc/commitdiff
* make vobsubs downloadable from http/ftp etc. closes #567
authorDerk-Jan Hartman <hartman@videolan.org>
Wed, 28 Feb 2007 20:05:59 +0000 (20:05 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Wed, 28 Feb 2007 20:05:59 +0000 (20:05 +0000)
 - NOTE: this will not work on user/password protected locations.

modules/demux/vobsub.c

index 09586a72de998ee6f4c2938dc1f7d05ffb7fd333..e5ebdb2e47cfc9d7bfa3e2c7fb44a331a08c07ee 100644 (file)
@@ -179,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 );