Originally committed as revision 16140 to svn://svn.ffmpeg.org/ffmpeg/trunktags/v0.5
| @@ -58,7 +58,8 @@ static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size, | |||||
| vp56_rac_gets(c, 8); /* number of displayed macroblock rows */ | vp56_rac_gets(c, 8); /* number of displayed macroblock rows */ | ||||
| vp56_rac_gets(c, 8); /* number of displayed macroblock cols */ | vp56_rac_gets(c, 8); /* number of displayed macroblock cols */ | ||||
| vp56_rac_gets(c, 2); | vp56_rac_gets(c, 2); | ||||
| if (16*cols != s->avctx->coded_width || | |||||
| if (!s->macroblocks || /* first frame */ | |||||
| 16*cols != s->avctx->coded_width || | |||||
| 16*rows != s->avctx->coded_height) { | 16*rows != s->avctx->coded_height) { | ||||
| avcodec_set_dimensions(s->avctx, 16*cols, 16*rows); | avcodec_set_dimensions(s->avctx, 16*cols, 16*rows); | ||||
| return 2; | return 2; | ||||
| @@ -657,8 +657,6 @@ av_cold void vp56_init(AVCodecContext *avctx, int flip, int has_alpha) | |||||
| dsputil_init(&s->dsp, avctx); | dsputil_init(&s->dsp, avctx); | ||||
| ff_init_scantable(s->dsp.idct_permutation, &s->scantable,ff_zigzag_direct); | ff_init_scantable(s->dsp.idct_permutation, &s->scantable,ff_zigzag_direct); | ||||
| avcodec_set_dimensions(avctx, 0, 0); | |||||
| for (i=0; i<4; i++) | for (i=0; i<4; i++) | ||||
| s->framep[i] = &s->frames[i]; | s->framep[i] = &s->frames[i]; | ||||
| s->framep[VP56_FRAME_UNUSED] = s->framep[VP56_FRAME_GOLDEN]; | s->framep[VP56_FRAME_UNUSED] = s->framep[VP56_FRAME_GOLDEN]; | ||||
| @@ -75,7 +75,8 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size, | |||||
| /* buf[4] is number of displayed macroblock rows */ | /* buf[4] is number of displayed macroblock rows */ | ||||
| /* buf[5] is number of displayed macroblock cols */ | /* buf[5] is number of displayed macroblock cols */ | ||||
| if (16*cols != s->avctx->coded_width || | |||||
| if (!s->macroblocks || /* first frame */ | |||||
| 16*cols != s->avctx->coded_width || | |||||
| 16*rows != s->avctx->coded_height) { | 16*rows != s->avctx->coded_height) { | ||||
| avcodec_set_dimensions(s->avctx, 16*cols, 16*rows); | avcodec_set_dimensions(s->avctx, 16*cols, 16*rows); | ||||
| if (s->avctx->extradata_size == 1) { | if (s->avctx->extradata_size == 1) { | ||||