comparison mpegvideo.c @ 1214:327c5a36dfe7 libavcodec

fixing mixed dr1 + internal buffers
author michaelni
date Fri, 25 Apr 2003 00:29:48 +0000
parents 818e75da4edd
children 9182f5e70e9b
comparison
equal deleted inserted replaced
1213:a71fe70b428b 1214:327c5a36dfe7
303 pic->mb_type= NULL; 303 pic->mb_type= NULL;
304 for(i=0; i<2; i++){ 304 for(i=0; i<2; i++){
305 av_freep(&pic->motion_val[i]); 305 av_freep(&pic->motion_val[i]);
306 av_freep(&pic->ref_index[i]); 306 av_freep(&pic->ref_index[i]);
307 } 307 }
308 308
309 if(pic->type == FF_BUFFER_TYPE_INTERNAL){ 309 if(pic->type == FF_BUFFER_TYPE_SHARED){
310 for(i=0; i<4; i++){
311 av_freep(&pic->base[i]);
312 pic->data[i]= NULL;
313 }
314 av_freep(&pic->opaque);
315 pic->type= 0;
316 }else if(pic->type == FF_BUFFER_TYPE_SHARED){
317 for(i=0; i<4; i++){ 310 for(i=0; i<4; i++){
318 pic->base[i]= 311 pic->base[i]=
319 pic->data[i]= NULL; 312 pic->data[i]= NULL;
320 } 313 }
321 pic->type= 0; 314 pic->type= 0;
522 av_freep(&s->mb_index2xy); 515 av_freep(&s->mb_index2xy);
523 516
524 for(i=0; i<MAX_PICTURE_COUNT; i++){ 517 for(i=0; i<MAX_PICTURE_COUNT; i++){
525 free_picture(s, &s->picture[i]); 518 free_picture(s, &s->picture[i]);
526 } 519 }
520 avcodec_default_free_buffers(s->avctx);
527 s->context_initialized = 0; 521 s->context_initialized = 0;
528 } 522 }
529 523
530 #ifdef CONFIG_ENCODERS 524 #ifdef CONFIG_ENCODERS
531 525
976 if(s->out_format != FMT_H264){ 970 if(s->out_format != FMT_H264){
977 if (s->pict_type != B_TYPE) { 971 if (s->pict_type != B_TYPE) {
978 s->last_picture_ptr= s->next_picture_ptr; 972 s->last_picture_ptr= s->next_picture_ptr;
979 s->next_picture_ptr= s->current_picture_ptr; 973 s->next_picture_ptr= s->current_picture_ptr;
980 } 974 }
975
981 if(s->last_picture_ptr) s->last_picture= *s->last_picture_ptr; 976 if(s->last_picture_ptr) s->last_picture= *s->last_picture_ptr;
982 if(s->next_picture_ptr) s->next_picture= *s->next_picture_ptr; 977 if(s->next_picture_ptr) s->next_picture= *s->next_picture_ptr;
983 if(s->new_picture_ptr ) s->new_picture = *s->new_picture_ptr; 978 if(s->new_picture_ptr ) s->new_picture = *s->new_picture_ptr;
984 979
985 if(s->picture_structure!=PICT_FRAME){ 980 if(s->picture_structure!=PICT_FRAME){