]> git.sesse.net Git - vlc/commitdiff
Used VLC_TS_INVALID in avformat demuxer.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 19 Dec 2009 09:22:07 +0000 (10:22 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 20 Dec 2009 22:23:26 +0000 (23:23 +0100)
modules/demux/avformat/demux.c

index 2e48e421ab7d268a525a001ec225efa7423905a9..4370bbf248f40552fee3f3a8b641c08d109c3adb 100644 (file)
@@ -446,11 +446,11 @@ static int Demux( demux_t *p_demux )
         ( p_sys->ic->start_time * 1000000 / AV_TIME_BASE )  : 0;
 
     p_frame->i_dts = ( pkt.dts == (int64_t)AV_NOPTS_VALUE ) ?
-        0 : (pkt.dts) * 1000000 *
+        VLC_TS_INVALID : (pkt.dts) * 1000000 *
         p_stream->time_base.num /
         p_stream->time_base.den - i_start_time;
     p_frame->i_pts = ( pkt.pts == (int64_t)AV_NOPTS_VALUE ) ?
-        0 : (pkt.pts) * 1000000 *
+        VLC_TS_INVALID : (pkt.pts) * 1000000 *
         p_stream->time_base.num /
         p_stream->time_base.den - i_start_time;
     if( pkt.duration > 0 )
@@ -463,14 +463,14 @@ static int Demux( demux_t *p_demux )
     {
         /* Add here notoriously bugged file formats/samples regarding PTS */
         if( !strcmp( p_sys->fmt->name, "flv" ) )
-            p_frame->i_pts = 0;
+            p_frame->i_pts = VLC_TS_INVALID;
     }
 #ifdef AVFORMAT_DEBUG
     msg_Dbg( p_demux, "tk[%d] dts=%"PRId64" pts=%"PRId64,
              pkt.stream_index, p_frame->i_dts, p_frame->i_pts );
 #endif
 
-    if( pkt.dts > 0  &&
+    if( p_frame->i_dts > VLC_TS_INVALID  &&
         ( pkt.stream_index == p_sys->i_pcr_tk || p_sys->i_pcr_tk < 0 ) )
     {
         p_sys->i_pcr_tk = pkt.stream_index;