mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
image_writer: use new AVFrame API
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user