changeset 3999:19dbf5d63f15 libavformat

Move code setting delay and presentation_delayed a little up so that the variables are available sooner.
author michael
date Sat, 18 Oct 2008 22:41:21 +0000
parents 692e5298a27a
children f0580597dc48
files utils.c
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Sat Oct 18 17:30:37 2008 +0000
+++ b/utils.c	Sat Oct 18 22:41:21 2008 +0000
@@ -824,6 +824,15 @@
     int num, den, presentation_delayed, delay, i;
     int64_t offset;
 
+    /* do we have a video B-frame ? */
+    delay= st->codec->has_b_frames;
+    presentation_delayed = 0;
+    /* XXX: need has_b_frame, but cannot get it if the codec is
+        not initialized */
+    if (delay &&
+        pc && pc->pict_type != FF_B_TYPE)
+        presentation_delayed = 1;
+
     if(pkt->pts != AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE && pkt->dts > pkt->pts && st->pts_wrap_bits<63
        /*&& pkt->dts-(1LL<<st->pts_wrap_bits) < pkt->pts*/){
         pkt->dts -= 1LL<<st->pts_wrap_bits;
@@ -850,14 +859,6 @@
             pkt->dts += offset;
     }
 
-    /* do we have a video B-frame ? */
-    delay= st->codec->has_b_frames;
-    presentation_delayed = 0;
-    /* XXX: need has_b_frame, but cannot get it if the codec is
-        not initialized */
-    if (delay &&
-        pc && pc->pict_type != FF_B_TYPE)
-        presentation_delayed = 1;
     /* This may be redundant, but it should not hurt. */
     if(pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts > pkt->dts)
         presentation_delayed = 1;