1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-04 09:11:33 +02:00

Used VLC_TS_INVALID/0 in NUV demuxer.

This commit is contained in:
Laurent Aimar 2009-12-20 21:11:47 +01:00
parent 360fbdaf78
commit 0e6740c576

View File

@ -389,18 +389,20 @@ static int Demux( demux_t *p_demux )
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 )