compute_pkt_fields: do not attempt to calculate dts when the delay hasnt been estimated.
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 4 Aug 2012 13:39:22 +0000 (15:39 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 4 Aug 2012 13:42:44 +0000 (15:42 +0200)
Fixes ticket1242

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index 7bd815c..af2575a 100644 (file)
@@ -1140,7 +1140,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
         }
     }
 
-    if(pkt->pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY){
+    if(pkt->pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY && has_decode_delay_been_guessed(st)){
         st->pts_buffer[0]= pkt->pts;
         for(i=0; i<delay && st->pts_buffer[i] > st->pts_buffer[i+1]; i++)
             FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i+1]);