if( !p_sys->b_seekable )
msg_Warn( p_demux, "stream is not seekable, skipping seektable" );
else if( SeekTableLoad( p_demux, p_sys ) )
- goto error;
-
+ {
+ p_sys->b_index = false;
+ msg_Warn( p_demux, "Seektable is broken, seek won't be accurate" );
+ }
}
else
{
fmt.video.i_height = p_sys->hdr.i_height;
fmt.i_extra = p_sys->i_extra_f;
fmt.p_extra = p_sys->p_extra_f;
- fmt.video.i_aspect = VOUT_ASPECT_FACTOR * p_sys->hdr.d_aspect;
+ fmt.video.i_sar_num = p_sys->hdr.d_aspect * fmt.video.i_height;
+ fmt.video.i_sar_den = fmt.video.i_width;
p_sys->p_es_video = es_out_Add( p_demux->out, &fmt );
}
if( ( p_data = stream_Block( p_demux->s, fh.i_length ) ) == NULL )
return 0;
- p_data->i_dts = (int64_t)fh.i_timecode * 1000;
- p_data->i_pts = (fh.i_type == 'V') ? 0 : p_data->i_dts;
+ p_data->i_dts = VLC_TS_0 + (int64_t)fh.i_timecode * 1000;
+ p_data->i_pts = (fh.i_type == 'V') ? VLC_TS_INVALID : p_data->i_dts;
/* only add keyframes to index */
if( !fh.i_keyframe && !p_sys->b_index )
- demux_IndexAppend( &p_sys->idx, p_data->i_dts, stream_Tell(p_demux->s) - NUV_FH_SIZE );
+ demux_IndexAppend( &p_sys->idx,
+ p_data->i_dts - VLC_TS_0,
+ stream_Tell(p_demux->s) - NUV_FH_SIZE );
/* */
- if( p_data->i_dts > p_sys->i_pcr )
+ if( p_sys->i_pcr < 0 || p_sys->i_pcr < p_data->i_dts - VLC_TS_0 )
{
- p_sys->i_pcr = p_data->i_dts;
- es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pcr );
+ p_sys->i_pcr = p_data->i_dts - VLC_TS_0;
+ es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_pcr );
}
if( fh.i_type == 'A' && p_sys->p_es_audio )