Revision 0701006e libavcodec/utils.c

View differences:

libavcodec/utils.c
147 147
    uint8_t *base[4];
148 148
    uint8_t *data[4];
149 149
    int linesize[4];
150
    int width, height;
151
    enum PixelFormat pix_fmt;
150 152
}InternalBuffer;
151 153

  
152 154
#define INTERNAL_BUFFER_SIZE 32
......
251 253
    picture_number= &(((InternalBuffer*)s->internal_buffer)[INTERNAL_BUFFER_SIZE-1]).last_pic_num; //FIXME ugly hack
252 254
    (*picture_number)++;
253 255

  
256
    if(buf->base[0] && (buf->width != w || buf->height != h || buf->pix_fmt != s->pix_fmt)){
257
        for(i=0; i<4; i++){
258
            av_freep(&buf->base[i]);
259
            buf->data[i]= NULL;
260
        }
261
    }
262

  
254 263
    if(buf->base[0]){
255 264
        pic->age= *picture_number - buf->last_pic_num;
256 265
        buf->last_pic_num= *picture_number;
......
306 315
            else
307 316
                buf->data[i] = buf->base[i] + ALIGN((buf->linesize[i]*EDGE_WIDTH>>v_shift) + (EDGE_WIDTH>>h_shift), STRIDE_ALIGN);
308 317
        }
318
        buf->width  = s->width;
319
        buf->height = s->height;
320
        buf->pix_fmt= s->pix_fmt;
309 321
        pic->age= 256*256*256*64;
310 322
    }
311 323
    pic->type= FF_BUFFER_TYPE_INTERNAL;

Also available in: Unified diff