}
/* Fill p_demux field */
- p_demux->pf_demux = Demux;
- p_demux->pf_control = Control;
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
if( !p_sys ) return VLC_ENOMEM;
+ p_demux->pf_demux = Demux;
+ p_demux->pf_control = Control;
+
/* Init p_sys */
p_sys->i_mux_rate = 0;
p_sys->i_scr = -1;
stream_Seek( p_demux->s, i_size - i_end );
i = 0;
- while( vlc_object_alive (p_demux) && i < 40 && Demux2( p_demux, true ) > 0 ) i++;
+ while( vlc_object_alive (p_demux) && i < 400 && Demux2( p_demux, true ) > 0 ) i++;
if( i_current_pos >= 0 ) stream_Seek( p_demux->s, i_current_pos );
}
for( int i = 0; i < PS_TK_COUNT; i++ )
{
ps_track_t *tk = &p_sys->tk[i];
- if( tk->i_first_pts >= 0 && tk->i_last_pts > 0 &&
+ if( tk->i_last_pts > 0 &&
tk->i_last_pts > tk->i_first_pts )
{
int64_t i_length = (int64_t)tk->i_last_pts - tk->i_first_pts;
{
p_sys->i_length = i_length;
p_sys->i_time_track = i;
- msg_Dbg( p_demux, "we found a length of: %"PRId64, p_sys->i_length );
+ msg_Dbg( p_demux, "we found a length of: %"PRId64 "s", p_sys->i_length / CLOCK_FREQ );
}
}
}
if( !tk->b_seen )
{
- if( !ps_track_fill( tk, &p_sys->psm, i_id ) )
+ if( !ps_track_fill( tk, &p_sys->psm, i_id, p_pkt ) )
{
tk->es = es_out_Add( p_demux->out, &tk->fmt );
b_new = true;
break;
}
+ demux_UpdateTitleFromStream( p_demux );
return 1;
}
}
return VLC_EGENERIC;
+ case DEMUX_GET_TITLE_INFO:
+ {
+ struct input_title_t ***v = va_arg( args, struct input_title_t*** );
+ int *c = va_arg( args, int * );
+
+ *va_arg( args, int* ) = 0; /* Title offset */
+ *va_arg( args, int* ) = 0; /* Chapter offset */
+ return stream_Control( p_demux->s, STREAM_GET_TITLE_INFO, v, c );
+ }
+
+ case DEMUX_SET_TITLE:
+ return stream_vaControl( p_demux->s, STREAM_SET_TITLE, args );
+
+ case DEMUX_SET_SEEKPOINT:
+ return stream_vaControl( p_demux->s, STREAM_SET_SEEKPOINT, args );
+
case DEMUX_GET_META:
- return stream_Control( p_demux->s, STREAM_GET_META, args );
+ return stream_vaControl( p_demux->s, STREAM_GET_META, args );
case DEMUX_GET_FPS:
default: