mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
libav: pass AVFrame back through #61
This commit is contained in:
parent
d423978e1b
commit
45697d54f9
@ -40,8 +40,7 @@ AVFrame* ncvisual_decode(struct ncvisual* nc){
|
||||
do{
|
||||
ret = avcodec_receive_frame(nc->codecctx, nc->frame);
|
||||
if(ret == AVERROR(EAGAIN) || ret == AVERROR_EOF){
|
||||
// FIXME can we still use nc->frame?
|
||||
return NULL;
|
||||
return nc->frame; // FIXME is this safe? could it have been blown away?
|
||||
}else if(ret < 0){
|
||||
fprintf(stderr, "Error decoding AVPacket (%s)\n", av_err2str(ret));
|
||||
return NULL;
|
||||
|
@ -12,7 +12,9 @@ void usage(std::ostream& o, const char* name, int exitcode){
|
||||
}
|
||||
|
||||
int ncview(struct ncvisual* ncv, const notcurses_options* opts){
|
||||
ncvisual_decode(ncv);
|
||||
if(ncvisual_decode(ncv) == nullptr){
|
||||
return -1;
|
||||
}
|
||||
auto nc = notcurses_init(opts);
|
||||
if(nc == nullptr){
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user