From aef66efb4e7da7a4751f3d8ed45f66d6cc8db7ed Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 1 Jun 2020 10:34:03 -0400 Subject: [PATCH] ncvisual_stream: honor first ncvisual_decode() --- src/lib/ffmpeg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/ffmpeg.cpp b/src/lib/ffmpeg.cpp index 7625c9a80..cd8a3d878 100644 --- a/src/lib/ffmpeg.cpp +++ b/src/lib/ffmpeg.cpp @@ -337,7 +337,7 @@ int ncvisual_stream(notcurses* nc, ncvisual* ncv, nc_err_e* ncerr, ncplane* newn = NULL; ncvisual_options activevopts; memcpy(&activevopts, vopts, sizeof(*vopts)); - while((*ncerr = ncvisual_decode(ncv)) == NCERR_SUCCESS){ + do{ // 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->details.fmtctx->streams[ncv->details.stream_index]->time_base); @@ -381,7 +381,7 @@ int ncvisual_stream(notcurses* nc, ncvisual* ncv, nc_err_e* ncerr, } return r; } - } + }while((*ncerr = ncvisual_decode(ncv)) == NCERR_SUCCESS); if(activevopts.n != vopts->n){ ncplane_destroy(activevopts.n); }