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

index 4370bbf248f40552fee3f3a8b641c08d109c3adb..3bce8e011c57d35d7c3a4b4ed89234508b54395b 100644 (file)
@@ -448,11 +448,11 @@ static int Demux( demux_t *p_demux )
     p_frame->i_dts = ( pkt.dts == (int64_t)AV_NOPTS_VALUE ) ?
         VLC_TS_INVALID : (pkt.dts) * 1000000 *
         p_stream->time_base.num /
-        p_stream->time_base.den - i_start_time;
+        p_stream->time_base.den - i_start_time + VLC_TS_0;
     p_frame->i_pts = ( pkt.pts == (int64_t)AV_NOPTS_VALUE ) ?
         VLC_TS_INVALID : (pkt.pts) * 1000000 *
         p_stream->time_base.num /
-        p_stream->time_base.den - i_start_time;
+        p_stream->time_base.den - i_start_time + VLC_TS_0;
     if( pkt.duration > 0 )
         p_frame->i_length = pkt.duration * 1000000 *
             p_stream->time_base.num /