From 1d66f890328cb5e0f66259e609fcf391e2e1c490 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 24 Apr 2020 03:58:31 -0400 Subject: [PATCH] ncvisual_stream: fix up ncerr assignment --- src/demo/xray.c | 1 - src/lib/libav.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/demo/xray.c b/src/demo/xray.c index cdd64ee7a..f09460fdb 100644 --- a/src/demo/xray.c +++ b/src/demo/xray.c @@ -108,7 +108,6 @@ int xray_demo(struct notcurses* nc){ char* path = find_data("notcursesI.avi"); nc_err_e err; struct ncvisual* ncv = ncplane_visual_open(n, path, &err); -fprintf(stderr, "NCV: %p %s\n", ncv, path); free(path); if(ncv == NULL){ return -1; diff --git a/src/lib/libav.c b/src/lib/libav.c index 294b9dee7..337f9fc23 100644 --- a/src/lib/libav.c +++ b/src/lib/libav.c @@ -459,7 +459,7 @@ int ncvisual_stream(notcurses* nc, ncvisual* ncv, nc_err_e* ncerr, // each frame has a pkt_duration in milliseconds. keep the aggregate, in case // we don't have PTS available. uint64_t sum_duration = 0; - while(ncvisual_decode(ncv) == NCERR_SUCCESS){ + while((*ncerr = ncvisual_decode(ncv)) == NCERR_SUCCESS){ // codecctx seems to be off by a factor of 2 regularly. instead, go with // the time_base from the avformatctx. double tbase = av_q2d(ncv->fmtctx->streams[ncv->stream_index]->time_base);