comparison h263dec.c @ 1026:d6ba0641cc36 libavcodec

cleanup
author michaelni
date Tue, 21 Jan 2003 21:30:48 +0000
parents 1f9afd8b9131
children 9fbad5cf7e9e
comparison
equal deleted inserted replaced
1025:1f9afd8b9131 1026:d6ba0641cc36
399 399
400 /* no supplementary picture */ 400 /* no supplementary picture */
401 if (buf_size == 0) { 401 if (buf_size == 0) {
402 return 0; 402 return 0;
403 } 403 }
404 404
405 if(s->flags&CODEC_FLAG_TRUNCATED){ 405 if(s->flags&CODEC_FLAG_TRUNCATED){
406 int next; 406 int next;
407 ParseContext *pc= &s->parse_context; 407
408
409 pc->last_index= pc->index;
410
411 if(s->codec_id==CODEC_ID_MPEG4){ 408 if(s->codec_id==CODEC_ID_MPEG4){
412 next= mpeg4_find_frame_end(s, buf, buf_size); 409 next= mpeg4_find_frame_end(s, buf, buf_size);
413 }else{ 410 }else{
414 fprintf(stderr, "this codec doesnt support truncated bitstreams\n"); 411 fprintf(stderr, "this codec doesnt support truncated bitstreams\n");
415 return -1; 412 return -1;
416 } 413 }
417 if(next==-1){ 414
418 if(buf_size + FF_INPUT_BUFFER_PADDING_SIZE + pc->index > pc->buffer_size){ 415 if( ff_combine_frame(s, next, &buf, &buf_size) < 0 )
419 pc->buffer_size= buf_size + pc->index + 10*1024;
420 pc->buffer= realloc(pc->buffer, pc->buffer_size);
421 }
422
423 memcpy(&pc->buffer[pc->index], buf, buf_size);
424 pc->index += buf_size;
425 return buf_size; 416 return buf_size;
426 }
427
428 if(pc->index){
429 if(next + FF_INPUT_BUFFER_PADDING_SIZE + pc->index > pc->buffer_size){
430 pc->buffer_size= next + pc->index + 10*1024;
431 pc->buffer= realloc(pc->buffer, pc->buffer_size);
432 }
433
434 memcpy(&pc->buffer[pc->index], buf, next + FF_INPUT_BUFFER_PADDING_SIZE );
435 pc->index = 0;
436 buf= pc->buffer;
437 buf_size= pc->last_index + next;
438 }
439 } 417 }
440 418
441 retry: 419 retry:
442 420
443 if(s->bitstream_buffer_size && buf_size<20){ //divx 5.01+ frame reorder 421 if(s->bitstream_buffer_size && buf_size<20){ //divx 5.01+ frame reorder