[vlc-devel] commit: Used VLC_TS_INVALID/0 in NUV demuxer. (Laurent Aimar )

git version control git at videolan.org
Mon Dec 21 00:02:33 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Dec 20 21:11:47 2009 +0100| [0e6740c57647192fe875fb44f7f0ed6587aaae33] | committer: Laurent Aimar 

Used VLC_TS_INVALID/0 in NUV demuxer.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0e6740c57647192fe875fb44f7f0ed6587aaae33
---

 modules/demux/nuv.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/modules/demux/nuv.c b/modules/demux/nuv.c
index 3f80660..7328f7e 100644
--- a/modules/demux/nuv.c
+++ b/modules/demux/nuv.c
@@ -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 )




More information about the vlc-devel mailing list