changeset 3554:e1e79e91af96 libavformat

10000l for myself, my last change was incomplete. This one also reverts the libav mpeg ts regression test score change.
author michael
date Tue, 08 Jul 2008 23:25:01 +0000
parents c3b9334f46ae
children 7ae5e02af8d9
files utils.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Tue Jul 08 23:20:22 2008 +0000
+++ b/utils.c	Tue Jul 08 23:25:01 2008 +0000
@@ -627,7 +627,7 @@
     AVStream *st= s->streams[stream_index];
     AVPacketList *pktl= s->packet_buffer;
 
-    if(st->first_dts != AV_NOPTS_VALUE || dts == AV_NOPTS_VALUE)
+    if(st->first_dts != AV_NOPTS_VALUE || dts == AV_NOPTS_VALUE || st->cur_dts == AV_NOPTS_VALUE)
         return;
 
     st->first_dts= dts - st->cur_dts;
@@ -746,6 +746,7 @@
             of the frame we are displaying, i.e. the last I- or P-frame */
             if (st->last_IP_duration == 0)
                 st->last_IP_duration = pkt->duration;
+            if(pkt->dts != AV_NOPTS_VALUE)
             st->cur_dts = pkt->dts + st->last_IP_duration;
             st->last_IP_duration  = pkt->duration;
             st->last_IP_pts= pkt->pts;
@@ -768,6 +769,7 @@
             if(pkt->pts == AV_NOPTS_VALUE)
                 pkt->pts = st->cur_dts;
             pkt->dts = pkt->pts;
+            if(pkt->pts != AV_NOPTS_VALUE)
             st->cur_dts = pkt->pts + pkt->duration;
         }
     }