comparison h264.c @ 4556:c140a3360e18 libavcodec

output delayed frames fixes: CANL4_SVA_B.264 NL3_SVA_C.264 NL3_SVA_E.264
author michael
date Wed, 21 Feb 2007 21:16:07 +0000
parents 1a714d3f0233
children 644687c58928
comparison
equal deleted inserted replaced
4555:8d1303d3777d 4556:c140a3360e18
8242 s->flags= avctx->flags; 8242 s->flags= avctx->flags;
8243 s->flags2= avctx->flags2; 8243 s->flags2= avctx->flags2;
8244 8244
8245 /* no supplementary picture */ 8245 /* no supplementary picture */
8246 if (buf_size == 0) { 8246 if (buf_size == 0) {
8247 Picture *out;
8248 int i, out_idx;
8249
8250 //FIXME factorize this with the output code below
8251 out = h->delayed_pic[0];
8252 out_idx = 0;
8253 for(i=1; h->delayed_pic[i] && !h->delayed_pic[i]->key_frame; i++)
8254 if(h->delayed_pic[i]->poc < out->poc){
8255 out = h->delayed_pic[i];
8256 out_idx = i;
8257 }
8258
8259 for(i=out_idx; h->delayed_pic[i]; i++)
8260 h->delayed_pic[i] = h->delayed_pic[i+1];
8261
8262 if(out){
8263 *data_size = sizeof(AVFrame);
8264 *pict= *(AVFrame*)out;
8265 }
8266
8247 return 0; 8267 return 0;
8248 } 8268 }
8249 8269
8250 if(s->flags&CODEC_FLAG_TRUNCATED){ 8270 if(s->flags&CODEC_FLAG_TRUNCATED){
8251 int next= find_frame_end(h, buf, buf_size); 8271 int next= find_frame_end(h, buf, buf_size);