lavc/avconv: support changing frame sizes in codecs with frame mt.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Ronald S. Bultje
2012-03-23 15:03:03 -07:00
committed by Anton Khirnov
parent e20ad71ebb
commit bc1ef85520
3 changed files with 11 additions and 13 deletions

View File

@@ -392,11 +392,6 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
buf = &avci->buffer[avci->buffer_count];
if(buf->base[0] && (buf->width != w || buf->height != h || buf->pix_fmt != s->pix_fmt)){
if(s->active_thread_type&FF_THREAD_FRAME) {
av_log_missing_feature(s, "Width/height changing with frame threads is", 0);
return -1;
}
for (i = 0; i < AV_NUM_DATA_POINTERS; i++) {
av_freep(&buf->base[i]);
buf->data[i]= NULL;
@@ -480,6 +475,10 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
}
pic->extended_data = pic->data;
avci->buffer_count++;
pic->width = buf->width;
pic->height = buf->height;
pic->format = buf->pix_fmt;
pic->sample_aspect_ratio = s->sample_aspect_ratio;
if(s->pkt) pic->pkt_pts= s->pkt->pts;
else pic->pkt_pts= AV_NOPTS_VALUE;