]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h261dec.c
sbrdsp: move #if to disable all educational code
[ffmpeg] / libavcodec / h261dec.c
index 479da779581cd4484da95f326882537f6785270f..d6e52729a13736c1d4e8872fbbe4dd21c708a7d2 100644 (file)
  */
 
 #include "avcodec.h"
+#include "mpegutils.h"
 #include "mpegvideo.h"
 #include "h263.h"
 #include "h261.h"
+#include "internal.h"
 
 #define H261_MBA_VLC_BITS 9
 #define H261_MTYPE_VLC_BITS 6
@@ -583,15 +585,6 @@ retry:
         if (ff_MPV_common_init(s) < 0)
             return -1;
 
-    /* We need to set current_picture_ptr before reading the header,
-     * otherwise we cannot store anything in there. */
-    if (s->current_picture_ptr == NULL || s->current_picture_ptr->f.data[0]) {
-        int i = ff_find_unused_picture(s, 0);
-        if (i < 0)
-            return i;
-        s->current_picture_ptr = &s->picture[i];
-    }
-
     ret = h261_decode_picture_header(h);
 
     /* skip if the header was thrashed */
@@ -607,7 +600,9 @@ retry:
         s->parse_context = pc;
     }
     if (!s->context_initialized) {
-        avcodec_set_dimensions(avctx, s->width, s->height);
+        ret = ff_set_dimensions(avctx, s->width, s->height);
+        if (ret < 0)
+            return ret;
 
         goto retry;
     }