mirror of
https://github.com/mpv-player/mpv
synced 2025-02-27 19:01:07 +00:00
screenshots: set AVFrame parameters
Currently, libavcodec is rather lenient, but it might get stricter in the future. Fixes #1398.
This commit is contained in:
parent
f808d9689e
commit
9270dda50a
@ -128,6 +128,9 @@ static int write_lavc(struct image_writer_ctx *ctx, mp_image_t *image, FILE *fp)
|
||||
pic->data[n] = image->planes[n];
|
||||
pic->linesize[n] = image->stride[n];
|
||||
}
|
||||
pic->format = avctx->pix_fmt;
|
||||
pic->width = avctx->width;
|
||||
pic->height = avctx->height;
|
||||
int ret = avcodec_encode_video2(avctx, &pkt, pic, &got_output);
|
||||
if (ret < 0)
|
||||
goto error_exit;
|
||||
|
Loading…
Reference in New Issue
Block a user