comparison mpeg12.c @ 10606:9ea5f2f1874f libavcodec

Move dummy picture allocation code from mpeg1/2 to mpegvideo. This fixes a infinite loop on a b frame.
author michael
date Mon, 30 Nov 2009 21:22:01 +0000
parents ce2cf9e32b09
children 6e672d7eb297
comparison
equal deleted inserted replaced
10605:2c2827f792a1 10606:9ea5f2f1874f
2432 if(!s2->current_picture_ptr){ 2432 if(!s2->current_picture_ptr){
2433 av_log(avctx, AV_LOG_ERROR, "current_picture not initialized\n"); 2433 av_log(avctx, AV_LOG_ERROR, "current_picture not initialized\n");
2434 return -1; 2434 return -1;
2435 } 2435 }
2436 2436
2437 if(s2->last_picture_ptr==NULL && s2->pict_type!=FF_I_TYPE){
2438 int i;
2439 /* Allocate a dummy frame */
2440 i= ff_find_unused_picture(s2, 0);
2441 s2->last_picture_ptr= &s2->picture[i];
2442 if(ff_alloc_picture(s2, s2->last_picture_ptr, 0) < 0)
2443 return -1;
2444 s2->last_picture= *s2->last_picture_ptr;
2445 }
2446 if(s2->next_picture_ptr==NULL && s2->pict_type==FF_B_TYPE){
2447 int i;
2448 /* Allocate a dummy frame */
2449 i= ff_find_unused_picture(s2, 0);
2450 s2->next_picture_ptr= &s2->picture[i];
2451 if(ff_alloc_picture(s2, s2->next_picture_ptr, 0) < 0)
2452 return -1;
2453 s2->next_picture= *s2->next_picture_ptr;
2454 }
2455
2456 if (avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) { 2437 if (avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) {
2457 s->slice_count++; 2438 s->slice_count++;
2458 break; 2439 break;
2459 } 2440 }
2460 2441