Commit b6be61a2 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* some fixes to vobsub

  TODO: create the index
        position control
parent 6d94b90c
...@@ -46,11 +46,12 @@ static void Close( vlc_object_t *p_this ); ...@@ -46,11 +46,12 @@ static void Close( vlc_object_t *p_this );
vlc_module_begin(); vlc_module_begin();
set_description( _("Vobsub subtitles demux") ); set_description( _("Vobsub subtitles demux") );
set_capability( "demux2", 0 ); set_capability( "demux2", 1 );
set_callbacks( Open, Close ); set_callbacks( Open, Close );
add_shortcut( "vobsub" ); add_shortcut( "vobsub" );
add_shortcut( "subtitle" );
vlc_module_end(); vlc_module_end();
/***************************************************************************** /*****************************************************************************
...@@ -114,12 +115,6 @@ static int Open ( vlc_object_t *p_this ) ...@@ -114,12 +115,6 @@ static int Open ( vlc_object_t *p_this )
demux_sys_t *p_sys; demux_sys_t *p_sys;
int i_max; int i_max;
if( strcmp( p_demux->psz_demux, "vobsub" ) )
{
msg_Dbg( p_demux, "vobsub demux discarded" );
return VLC_EGENERIC;
}
p_demux->pf_demux = Demux; p_demux->pf_demux = Demux;
p_demux->pf_control = Control; p_demux->pf_control = Control;
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
...@@ -427,6 +422,7 @@ static int ParseVobSubIDX( demux_t *p_demux ) ...@@ -427,6 +422,7 @@ static int ParseVobSubIDX( demux_t *p_demux )
return( VLC_EGENERIC ); return( VLC_EGENERIC );
} }
msg_Dbg( p_demux, "%s", line );
if( *line == 0 || *line == '\r' || *line == '\n' || *line == '#' ) if( *line == 0 || *line == '\r' || *line == '\n' || *line == '#' )
continue; continue;
else if( !strncmp( "size:", line, 5 ) ) else if( !strncmp( "size:", line, 5 ) )
...@@ -449,7 +445,7 @@ static int ParseVobSubIDX( demux_t *p_demux ) ...@@ -449,7 +445,7 @@ static int ParseVobSubIDX( demux_t *p_demux )
es_format_t fmt; es_format_t fmt;
/* Lets start a new track */ /* Lets start a new track */
if( sscanf( line, "id: %s, index: %d", if( sscanf( line, "id: %2s, index: %d",
language, &i_track_id ) == 2 ) language, &i_track_id ) == 2 )
{ {
p_sys->i_tracks++; p_sys->i_tracks++;
...@@ -494,7 +490,6 @@ static int ParseVobSubIDX( demux_t *p_demux ) ...@@ -494,7 +490,6 @@ static int ParseVobSubIDX( demux_t *p_demux )
(mtime_t)s * 1000 + (mtime_t)s * 1000 +
(mtime_t)ms ) * 1000; (mtime_t)ms ) * 1000;
i_location = loc; i_location = loc;
break;
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment