ncvisual: free up image alloc #241

This commit is contained in:
nick black 2020-01-01 07:07:45 -05:00
parent 9fdee8f672
commit bc1f9bfb43
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 4 additions and 5 deletions

View File

@ -19,7 +19,7 @@ void ncvisual_destroy(ncvisual* ncv){
avcodec_close(ncv->codecctx);
avcodec_free_context(&ncv->codecctx);
av_frame_free(&ncv->frame);
// av_frame_free(&ncv->oframe); FIXME
// av_frame_unref(ncv->oframe); FIXME
avcodec_parameters_free(&ncv->cparams);
sws_freeContext(ncv->swsctx);
av_packet_free(&ncv->packet);
@ -370,6 +370,8 @@ int ncvisual_render(const ncvisual* ncv, int begy, int begx, int leny, int lenx)
}
}
}
av_freep(&ncv->oframe->data[0]);
//av_frame_unref(ncv->oframe);
return 0;
}

View File

@ -47,9 +47,6 @@ int perframe(struct notcurses* nc, struct ncvisual* ncv, void* vframecount){
ns -= s * NANOSECS_IN_SEC;
ncplane_printf_aligned(stdn, 0, NCALIGN_RIGHT, "%02ld:%02ld:%02ld.%04ld",
h, m, s, ns / 1000000);
if(ncvisual_render(ncv, 0, 0, 0, 0)){
return -1;
}
if(notcurses_render(nc)){
return -1;
}