]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/proresdec2.c
avformat/chromaprint: improve logging message
[ffmpeg] / libavcodec / proresdec2.c
index 6209c229c9d01821ac4c707e344367824e7ccba5..2652a31c81f9c7e90457d4e0ee2f0bebddc920f7 100644 (file)
@@ -778,9 +778,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     buf += frame_hdr_size;
     buf_size -= frame_hdr_size;
 
-    if ((ret = ff_thread_get_buffer(avctx, &tframe, 0)) < 0)
-        return ret;
-
  decode_picture:
     pic_size = decode_picture_header(avctx, buf, buf_size);
     if (pic_size < 0) {
@@ -788,6 +785,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return pic_size;
     }
 
+    if (ctx->first_field)
+        if ((ret = ff_thread_get_buffer(avctx, &tframe, 0)) < 0)
+            return ret;
+
     if ((ret = decode_picture(avctx)) < 0) {
         av_log(avctx, AV_LOG_ERROR, "error decoding picture\n");
         return ret;