Mercurial > libavcodec.hg
comparison utils.c @ 7307:52764a3665d8 libavcodec
Make the ugly hack which uses an unused entry in the internal buffer
array actually use a unused one, so it does work.
author | michael |
---|---|
date | Sat, 19 Jul 2008 00:32:15 +0000 |
parents | dddc7406c5b6 |
children | 3f49e04bcbe1 |
comparison
equal
deleted
inserted
replaced
7306:7950572e58eb | 7307:52764a3665d8 |
---|---|
193 | 193 |
194 if(avcodec_check_dimensions(s,w,h)) | 194 if(avcodec_check_dimensions(s,w,h)) |
195 return -1; | 195 return -1; |
196 | 196 |
197 if(s->internal_buffer==NULL){ | 197 if(s->internal_buffer==NULL){ |
198 s->internal_buffer= av_mallocz(INTERNAL_BUFFER_SIZE*sizeof(InternalBuffer)); | 198 s->internal_buffer= av_mallocz((INTERNAL_BUFFER_SIZE+1)*sizeof(InternalBuffer)); |
199 } | 199 } |
200 #if 0 | 200 #if 0 |
201 s->internal_buffer= av_fast_realloc( | 201 s->internal_buffer= av_fast_realloc( |
202 s->internal_buffer, | 202 s->internal_buffer, |
203 &s->internal_buffer_size, | 203 &s->internal_buffer_size, |
204 sizeof(InternalBuffer)*FFMAX(99, s->internal_buffer_count+1)/*FIXME*/ | 204 sizeof(InternalBuffer)*FFMAX(99, s->internal_buffer_count+1)/*FIXME*/ |
205 ); | 205 ); |
206 #endif | 206 #endif |
207 | 207 |
208 buf= &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count]; | 208 buf= &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count]; |
209 picture_number= &(((InternalBuffer*)s->internal_buffer)[INTERNAL_BUFFER_SIZE-1]).last_pic_num; //FIXME ugly hack | 209 picture_number= &(((InternalBuffer*)s->internal_buffer)[INTERNAL_BUFFER_SIZE]).last_pic_num; //FIXME ugly hack |
210 (*picture_number)++; | 210 (*picture_number)++; |
211 | 211 |
212 if(buf->base[0] && (buf->width != w || buf->height != h || buf->pix_fmt != s->pix_fmt)){ | 212 if(buf->base[0] && (buf->width != w || buf->height != h || buf->pix_fmt != s->pix_fmt)){ |
213 for(i=0; i<4; i++){ | 213 for(i=0; i<4; i++){ |
214 av_freep(&buf->base[i]); | 214 av_freep(&buf->base[i]); |