mirror of https://github.com/mpv-player/mpv
image_writer: use new AVFrame API
This commit is contained in:
parent
f2374f4e4b
commit
62ab6a91bd
|
@ -123,10 +123,9 @@ static int write_lavc(struct image_writer_ctx *ctx, mp_image_t *image, FILE *fp)
|
|||
goto error_exit;
|
||||
}
|
||||
|
||||
pic = avcodec_alloc_frame();
|
||||
pic = av_frame_alloc();
|
||||
if (!pic)
|
||||
goto error_exit;
|
||||
avcodec_get_frame_defaults(pic);
|
||||
for (int n = 0; n < 4; n++) {
|
||||
pic->data[n] = image->planes[n];
|
||||
pic->linesize[n] = image->stride[n];
|
||||
|
@ -142,7 +141,7 @@ error_exit:
|
|||
if (avctx)
|
||||
avcodec_close(avctx);
|
||||
av_free(avctx);
|
||||
avcodec_free_frame(&pic);
|
||||
av_frame_free(&pic);
|
||||
av_free_packet(&pkt);
|
||||
return success;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue