comparison 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
comparison
equal deleted inserted replaced
7282:dc5a334c758b 7283:39e81fdd8d23
3300 3300
3301 /* forget old pics after a seek */ 3301 /* forget old pics after a seek */
3302 static void flush_dpb(AVCodecContext *avctx){ 3302 static void flush_dpb(AVCodecContext *avctx){
3303 H264Context *h= avctx->priv_data; 3303 H264Context *h= avctx->priv_data;
3304 int i; 3304 int i;
3305 for(i=0; i<16; i++) { 3305 for(i=0; i<MAX_DELAYED_PIC_COUNT; i++) {
3306 if(h->delayed_pic[i]) 3306 if(h->delayed_pic[i])
3307 h->delayed_pic[i]->reference= 0; 3307 h->delayed_pic[i]->reference= 0;
3308 h->delayed_pic[i]= NULL; 3308 h->delayed_pic[i]= NULL;
3309 } 3309 }
3310 if(h->delayed_output_pic) 3310 if(h->delayed_output_pic)
7834 } 7834 }
7835 7835
7836 pics = 0; 7836 pics = 0;
7837 while(h->delayed_pic[pics]) pics++; 7837 while(h->delayed_pic[pics]) pics++;
7838 7838
7839 assert(pics+1 < sizeof(h->delayed_pic) / sizeof(h->delayed_pic[0])); 7839 assert(pics <= MAX_DELAYED_PIC_COUNT);
7840 7840
7841 h->delayed_pic[pics++] = cur; 7841 h->delayed_pic[pics++] = cur;
7842 if(cur->reference == 0) 7842 if(cur->reference == 0)
7843 cur->reference = DELAYED_PIC_REF; 7843 cur->reference = DELAYED_PIC_REF;
7844 7844