Mercurial > libavcodec.hg
diff h264.c @ 7283:39e81fdd8d23 libavcodec
Move the size of the H264Context delayed_pic array into a #define.
This improves readability by getting rid of some magic numbers.
author | astrange |
---|---|
date | Tue, 15 Jul 2008 21:30:04 +0000 |
parents | 2bd9df0236e8 |
children | 1595c063d68d |
line wrap: on
line diff
--- a/h264.c Tue Jul 15 19:06:32 2008 +0000 +++ b/h264.c Tue Jul 15 21:30:04 2008 +0000 @@ -3302,7 +3302,7 @@ static void flush_dpb(AVCodecContext *avctx){ H264Context *h= avctx->priv_data; int i; - for(i=0; i<16; i++) { + for(i=0; i<MAX_DELAYED_PIC_COUNT; i++) { if(h->delayed_pic[i]) h->delayed_pic[i]->reference= 0; h->delayed_pic[i]= NULL; @@ -7836,7 +7836,7 @@ pics = 0; while(h->delayed_pic[pics]) pics++; - assert(pics+1 < sizeof(h->delayed_pic) / sizeof(h->delayed_pic[0])); + assert(pics <= MAX_DELAYED_PIC_COUNT); h->delayed_pic[pics++] = cur; if(cur->reference == 0)