ncvisual_stream: honor first ncvisual_decode()

This commit is contained in:
nick black 2020-06-01 10:34:03 -04:00
parent 4fb012a12d
commit aef66efb4e
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

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