Mercurial > libavcodec.hg
diff h263dec.c @ 1026:d6ba0641cc36 libavcodec
cleanup
author | michaelni |
---|---|
date | Tue, 21 Jan 2003 21:30:48 +0000 |
parents | 1f9afd8b9131 |
children | 9fbad5cf7e9e |
line wrap: on
line diff
--- a/h263dec.c Tue Jan 21 17:34:12 2003 +0000 +++ b/h263dec.c Tue Jan 21 21:30:48 2003 +0000 @@ -401,41 +401,19 @@ if (buf_size == 0) { return 0; } - + if(s->flags&CODEC_FLAG_TRUNCATED){ int next; - ParseContext *pc= &s->parse_context; - pc->last_index= pc->index; - if(s->codec_id==CODEC_ID_MPEG4){ next= mpeg4_find_frame_end(s, buf, buf_size); }else{ fprintf(stderr, "this codec doesnt support truncated bitstreams\n"); return -1; } - if(next==-1){ - if(buf_size + FF_INPUT_BUFFER_PADDING_SIZE + pc->index > pc->buffer_size){ - pc->buffer_size= buf_size + pc->index + 10*1024; - pc->buffer= realloc(pc->buffer, pc->buffer_size); - } - - memcpy(&pc->buffer[pc->index], buf, buf_size); - pc->index += buf_size; + + if( ff_combine_frame(s, next, &buf, &buf_size) < 0 ) return buf_size; - } - - if(pc->index){ - if(next + FF_INPUT_BUFFER_PADDING_SIZE + pc->index > pc->buffer_size){ - pc->buffer_size= next + pc->index + 10*1024; - pc->buffer= realloc(pc->buffer, pc->buffer_size); - } - - memcpy(&pc->buffer[pc->index], buf, next + FF_INPUT_BUFFER_PADDING_SIZE ); - pc->index = 0; - buf= pc->buffer; - buf_size= pc->last_index + next; - } } retry: