- if ((ret = avpicture_layout((const AVPicture *)frame, avctx->pix_fmt, avctx->width,
- avctx->height, pkt->data, pkt->size)) < 0)
+ if ((ret = avpicture_layout((const AVPicture *)frame, frame->format, frame->width,
+ frame->height, pkt->data, pkt->size)) < 0)