changeset 2538:34b0996cc10d libavcodec

10l (fix reordering when B-frames are not present)
author lorenm
date Sat, 05 Mar 2005 00:14:21 +0000
parents 14fef0f3f532
children 1fefaaee0fdc
files h264.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Fri Mar 04 12:47:38 2005 +0000
+++ b/h264.c	Sat Mar 05 00:14:21 2005 +0000
@@ -6310,7 +6310,8 @@
             if(s->flags& CODEC_FLAG_LOW_DELAY)
                 s->low_delay=1;
       
-            avctx->has_b_frames= !s->low_delay;
+            if(avctx->has_b_frames < 2)
+                avctx->has_b_frames= !s->low_delay;
             break;
         case NAL_PPS:
             init_get_bits(&s->gb, ptr, bit_length);
@@ -6470,6 +6471,9 @@
             }
         if(cur->reference == 0)
             cur->reference = 1;
+        for(i=0; h->delayed_pic[i]; i++)
+            if(h->delayed_pic[i]->key_frame)
+                h->delayed_output_poc = -1;
         if(pics > FFMAX(1, s->avctx->has_b_frames)){
             if(out->reference == 1)
                 out->reference = 0;
@@ -6477,10 +6481,6 @@
                 h->delayed_pic[i] = h->delayed_pic[i+1];
         }
 
-        for(i=0; h->delayed_pic[i]; i++)
-            if(h->delayed_pic[i]->key_frame)
-                h->delayed_output_poc = -1;
-
         if((h->delayed_output_poc >=0 && h->delayed_output_poc > cur->poc)
           || (s->low_delay && (cur->pict_type == B_TYPE
               || (!h->sps.gaps_in_frame_num_allowed_flag