notcurses-view: keypress skips, not aborts

This commit is contained in:
nick black 2020-01-07 10:42:40 -05:00
parent acef43c759
commit a56846468e
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -130,12 +130,13 @@ int main(int argc, char** argv){
return EXIT_FAILURE;
}
clock_gettime(CLOCK_MONOTONIC, &start);
if(ncvisual_stream(nc, ncv, &averr, perframe, &frames)){
int r = ncvisual_stream(nc, ncv, &averr, perframe, &frames);
if(r < 0){ // positive is intentional abort
av_make_error_string(errbuf.data(), errbuf.size(), averr);
notcurses_stop(nc);
std::cerr << "Error decoding " << argv[i] << ": " << errbuf.data() << std::endl;
return EXIT_FAILURE;
}
}else if(r == 0){
char32_t ie = notcurses_getc_blocking(nc, nullptr);
if(ie == (char32_t)-1){
break;
@ -151,6 +152,7 @@ int main(int argc, char** argv){
return EXIT_FAILURE;
}
}
}
ncvisual_destroy(ncv);
}
if(notcurses_stop(nc)){