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

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


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Dec 19 10:22:07 2009 +0100| [56e612060552f66196e48ddcb13282b867b77ccf] | committer: Laurent Aimar 

Used VLC_TS_INVALID in avformat demuxer.

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

 modules/demux/avformat/demux.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 2e48e42..4370bbf 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -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;




More information about the vlc-devel mailing list