mirror of
https://github.com/mpv-player/mpv
synced 2025-02-18 05:37:04 +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
2c20c6f892
commit
e0231926df
@ -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