ncvisual_stream(): fix oiio for eager decode #721

This commit is contained in:
nick black 2020-06-16 12:02:23 -04:00
parent 0be0b208de
commit c286a8ae9b
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -146,7 +146,7 @@ auto ncvisual_stream(notcurses* nc, ncvisual* ncv, nc_err_e* ncerr, float timesc
ncplane* newn = nullptr; ncplane* newn = nullptr;
ncvisual_options activevopts; ncvisual_options activevopts;
memcpy(&activevopts, vopts, sizeof(*vopts)); memcpy(&activevopts, vopts, sizeof(*vopts));
while((*ncerr = ncvisual_decode(ncv)) == NCERR_SUCCESS){ do{
if((newn = ncvisual_render(nc, ncv, &activevopts)) == NULL){ if((newn = ncvisual_render(nc, ncv, &activevopts)) == NULL){
if(activevopts.n != vopts->n){ if(activevopts.n != vopts->n){
ncplane_destroy(activevopts.n); ncplane_destroy(activevopts.n);
@ -163,6 +163,8 @@ auto ncvisual_stream(notcurses* nc, ncvisual* ncv, nc_err_e* ncerr, float timesc
int r; int r;
if(streamer){ if(streamer){
r = streamer(ncv, &activevopts, &now, curry); r = streamer(ncv, &activevopts, &now, curry);
}else{
r = ncvisual_simple_streamer(ncv, &activevopts, &now, curry);
} }
if(r){ if(r){
if(activevopts.n != vopts->n){ if(activevopts.n != vopts->n){
@ -171,7 +173,7 @@ auto ncvisual_stream(notcurses* nc, ncvisual* ncv, nc_err_e* ncerr, float timesc
return r; return r;
} }
++frame; ++frame;
} }while((*ncerr = ncvisual_decode(ncv)) == NCERR_SUCCESS);
if(activevopts.n != vopts->n){ if(activevopts.n != vopts->n){
ncplane_destroy(activevopts.n); ncplane_destroy(activevopts.n);
} }