diff options
author | Loren Merritt <lorenm@u.washington.edu> | 2005-03-05 00:14:21 +0000 |
---|---|---|
committer | Loren Merritt <lorenm@u.washington.edu> | 2005-03-05 00:14:21 +0000 |
commit | a18030bb622872aa46cf82ed4094fa178e1d1635 (patch) | |
tree | dc1df2051fa141b73fd8c169b87bd739adc6a5b0 | |
parent | 2f944356bf51a397aa7ba596d13763e30b4f5823 (diff) | |
download | ffmpeg-a18030bb622872aa46cf82ed4094fa178e1d1635.tar.gz |
10l (fix reordering when B-frames are not present)
Originally committed as revision 4004 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/h264.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index d53b91d93c..a059449efc 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -6310,7 +6310,8 @@ static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){ 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 @@ static int decode_frame(AVCodecContext *avctx, } 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 @@ static int decode_frame(AVCodecContext *avctx, 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 |