comparison mpegvideo.c @ 6867:8f656b589911 libavcodec

Fix MB skipping with droppable frames. Fixes issue323.
author michael
date Sun, 25 May 2008 14:07:35 +0000
parents 7ecd59aa5757
children 778ecab25dd8
comparison
equal deleted inserted replaced
6866:e627df327e77 6867:8f656b589911
234 } 234 }
235 235
236 /* It might be nicer if the application would keep track of these 236 /* It might be nicer if the application would keep track of these
237 * but it would require an API change. */ 237 * but it would require an API change. */
238 memmove(s->prev_pict_types+1, s->prev_pict_types, PREV_PICT_TYPES_BUFFER_SIZE-1); 238 memmove(s->prev_pict_types+1, s->prev_pict_types, PREV_PICT_TYPES_BUFFER_SIZE-1);
239 s->prev_pict_types[0]= s->pict_type; 239 s->prev_pict_types[0]= s->dropable ? FF_B_TYPE : s->pict_type;
240 if(pic->age < PREV_PICT_TYPES_BUFFER_SIZE && s->prev_pict_types[pic->age] == FF_B_TYPE) 240 if(pic->age < PREV_PICT_TYPES_BUFFER_SIZE && s->prev_pict_types[pic->age] == FF_B_TYPE)
241 pic->age= INT_MAX; // Skipped MBs in B-frames are quite rare in MPEG-1/2 and it is a bit tricky to skip them anyway. 241 pic->age= INT_MAX; // Skipped MBs in B-frames are quite rare in MPEG-1/2 and it is a bit tricky to skip them anyway.
242 242
243 return 0; 243 return 0;
244 fail: //for the CHECKED_ALLOCZ macro 244 fail: //for the CHECKED_ALLOCZ macro