image_writer: use new AVFrame API

This commit is contained in:
wm4 2014-03-16 12:51:58 +01:00
parent f2374f4e4b
commit 62ab6a91bd
1 changed files with 2 additions and 3 deletions

View File

@ -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;
}