changeset 8329:8b6bcfa22aa8 libavcodec

vp56: don't reset dimensions to 0 in codec init
author aurel
date Mon, 15 Dec 2008 00:00:16 +0000
parents 2e654989814e
children 7c00e980c153
files vp5.c vp56.c vp6.c
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/vp5.c	Sun Dec 14 21:38:03 2008 +0000
+++ b/vp5.c	Mon Dec 15 00:00:16 2008 +0000
@@ -58,7 +58,8 @@
         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;
--- a/vp56.c	Sun Dec 14 21:38:03 2008 +0000
+++ b/vp56.c	Mon Dec 15 00:00:16 2008 +0000
@@ -657,8 +657,6 @@
     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];
--- a/vp6.c	Sun Dec 14 21:38:03 2008 +0000
+++ b/vp6.c	Mon Dec 15 00:00:16 2008 +0000
@@ -75,7 +75,8 @@
         /* 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) {