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) {
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;