mirror of
https://github.com/mpv-player/mpv
synced 2025-01-10 00:49:32 +00:00
image_writer: error check avif-pixfmt option
This commit is contained in:
parent
8aa8e21da9
commit
8f26d99fbd
@ -371,6 +371,11 @@ static bool write_avif(struct image_writer_ctx *ctx, mp_image_t *image,
|
|||||||
avctx->pkt_timebase = (AVRational){1, 30};
|
avctx->pkt_timebase = (AVRational){1, 30};
|
||||||
avctx->codec_type = AVMEDIA_TYPE_VIDEO;
|
avctx->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||||
avctx->pix_fmt = imgfmt2pixfmt(image->imgfmt);
|
avctx->pix_fmt = imgfmt2pixfmt(image->imgfmt);
|
||||||
|
if (avctx->pix_fmt == AV_PIX_FMT_NONE) {
|
||||||
|
MP_ERR(ctx, "Image format %s not supported by lavc.\n",
|
||||||
|
mp_imgfmt_to_name(image->imgfmt));
|
||||||
|
goto free_data;
|
||||||
|
}
|
||||||
|
|
||||||
av_opt_set_int(avctx, "still-picture", 1, AV_OPT_SEARCH_CHILDREN);
|
av_opt_set_int(avctx, "still-picture", 1, AV_OPT_SEARCH_CHILDREN);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user