[FFmpeg-cvslog] r12157 - trunk/libavformat/utils.c

michael subversion
Wed Feb 20 04:40:08 CET 2008


Author: michael
Date: Wed Feb 20 04:40:07 2008
New Revision: 12157

Log:
Get rid of a fake timestamp discontinuity at the begin of V.VOB.
This solution isnt really correct but its quite simple, correct would
be to do a second pass over the packets after all the headers have been
collected.


Modified:
   trunk/libavformat/utils.c

Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	(original)
+++ trunk/libavformat/utils.c	Wed Feb 20 04:40:07 2008
@@ -641,7 +641,8 @@ static void update_initial_durations(AVF
     for(; pktl; pktl= pktl->next){
         if(pktl->pkt.stream_index != pkt->stream_index)
             continue;
-        if(pktl->pkt.pts == pktl->pkt.dts && pktl->pkt.dts == AV_NOPTS_VALUE){
+        if(pktl->pkt.pts == pktl->pkt.dts && pktl->pkt.dts == AV_NOPTS_VALUE
+           && !pktl->pkt.duration){
             pktl->pkt.pts= pktl->pkt.dts= st->cur_dts;
             st->cur_dts += pkt->duration;
             pktl->pkt.duration= pkt->duration;
@@ -666,7 +667,7 @@ static void compute_pkt_fields(AVFormatC
         if (den && num) {
             pkt->duration = av_rescale(1, num * (int64_t)st->time_base.den, den * (int64_t)st->time_base.num);
 
-            if(pkt->dts == AV_NOPTS_VALUE && pkt->pts == AV_NOPTS_VALUE && st->cur_dts == 0)
+            if(st->cur_dts == 0)
                 update_initial_durations(s, st, pkt);
         }
     }




More information about the ffmpeg-cvslog mailing list