]> git.sesse.net Git - vlc/commitdiff
Used VLC_TS_INVALID/0 in NUV demuxer.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 20 Dec 2009 20:11:47 +0000 (21:11 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 20 Dec 2009 22:23:28 +0000 (23:23 +0100)
modules/demux/nuv.c

index 3f80660591bddaade9f6799088f29fc241371685..7328f7e4e390a0915de9ad5373b7010fb373b16c 100644 (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 )