aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h263dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-01-21 21:30:48 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-01-21 21:30:48 +0000
commitb7a22d846b581bfd9eebf8710eeefa1948495db9 (patch)
treeef7c0114a5c82d1cd09663de5c12676da9ba81d7 /libavcodec/h263dec.c
parent68f593b48433842f3407586679fe07f3e5199ab9 (diff)
downloadffmpeg-b7a22d846b581bfd9eebf8710eeefa1948495db9.tar.gz
cleanup
Originally committed as revision 1487 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r--libavcodec/h263dec.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 3e4610658c..1ac7366290 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -401,41 +401,19 @@ uint64_t time= rdtsc();
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: