libav: disable stderr logging #174

pull/193/head
nick black 5 years ago
parent 0e6c921b28
commit 1ebe02cf93
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -143,6 +143,9 @@ int prep_special_keys(notcurses* nc);
// free up the input escapes trie // free up the input escapes trie
void input_free_esctrie(struct esctrie** trie); void input_free_esctrie(struct esctrie** trie);
// initialize libav
int ncvisual_init(void);
static inline void static inline void
ncplane_lock(const ncplane* n){ ncplane_lock(const ncplane* n){
pthread_mutex_lock(&n->nc->lock); pthread_mutex_lock(&n->nc->lock);

@ -255,9 +255,6 @@ ncvisual* ncplane_visual_open(ncplane* nc, const char* filename, int* averr){
return NULL; return NULL;
} }
ncplane_dim_yx(nc, &ncv->dstheight, &ncv->dstwidth); ncplane_dim_yx(nc, &ncv->dstheight, &ncv->dstwidth);
// FIXME we only want to do this if we're not already large enough to
// faithfully reproduce the image, methinks?
// ncv->dstwidth *= 2;
ncv->dstheight *= 2; ncv->dstheight *= 2;
ncv->ncp = nc; ncv->ncp = nc;
ncv->style = NCSCALE_STRETCH; ncv->style = NCSCALE_STRETCH;
@ -277,3 +274,9 @@ ncvisual* ncvisual_open_plane(notcurses* nc, const char* filename,
ncv->ncp = NULL; ncv->ncp = NULL;
return ncv; return ncv;
} }
int ncvisual_init(void){
av_log_set_level(AV_LOG_QUIET); // FIXME make this configurable?
// FIXME could also use av_log_set_callback() and capture the message...
return 0;
}

@ -763,6 +763,9 @@ notcurses* notcurses_init(const notcurses_options* opts, FILE* outfp){
if(interrogate_terminfo(ret, opts)){ if(interrogate_terminfo(ret, opts)){
goto err; goto err;
} }
if(ncvisual_init()){
goto err;
}
if((ret->stdscr = create_initial_ncplane(ret)) == NULL){ if((ret->stdscr = create_initial_ncplane(ret)) == NULL){
goto err; goto err;
} }

Loading…
Cancel
Save