diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2008-12-15 00:00:16 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2008-12-15 00:00:16 +0000 |
commit | bf73801bec57fafbf160ee10d072d64b8bb510ba (patch) | |
tree | 5920fb567b7f16893be3d11b73c75d0aa6ead9c5 | |
parent | b9b2b8c93b40a2d96f25362e9c8d7611d0adc3c7 (diff) | |
download | ffmpeg-bf73801bec57fafbf160ee10d072d64b8bb510ba.tar.gz |
vp56: don't reset dimensions to 0 in codec init
Originally committed as revision 16140 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/vp5.c | 3 | ||||
-rw-r--r-- | libavcodec/vp56.c | 2 | ||||
-rw-r--r-- | libavcodec/vp6.c | 3 |
3 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c index 7b39c81cb4..e47db0d2c1 100644 --- a/libavcodec/vp5.c +++ b/libavcodec/vp5.c @@ -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 cols */ 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) { avcodec_set_dimensions(s->avctx, 16*cols, 16*rows); return 2; diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c index 663c267213..79667cf263 100644 --- a/libavcodec/vp56.c +++ b/libavcodec/vp56.c @@ -657,8 +657,6 @@ av_cold void vp56_init(AVCodecContext *avctx, int flip, int has_alpha) dsputil_init(&s->dsp, avctx); ff_init_scantable(s->dsp.idct_permutation, &s->scantable,ff_zigzag_direct); - avcodec_set_dimensions(avctx, 0, 0); - for (i=0; i<4; i++) s->framep[i] = &s->frames[i]; s->framep[VP56_FRAME_UNUSED] = s->framep[VP56_FRAME_GOLDEN]; diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index d8fc0efb3a..6ffde072f7 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -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[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) { avcodec_set_dimensions(s->avctx, 16*cols, 16*rows); if (s->avctx->extradata_size == 1) { |