poll() on write() EAGAIN

pull/98/head
nick black 5 years ago
parent 1dc254396b
commit b882fe4e40
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -102,7 +102,7 @@ AVFrame* ncvisual_decode(struct ncvisual* nc, int* averr){
return NULL;
}
}while(!have_frame);
print_frame_summary(nc->codecctx, nc->frame);
//print_frame_summary(nc->codecctx, nc->frame);
#define IMGALLOCALIGN 32
const int targformat = AV_PIX_FMT_RGBA;
nc->swsctx = sws_getCachedContext(nc->swsctx,
@ -135,7 +135,7 @@ print_frame_summary(nc->codecctx, nc->frame);
fprintf(stderr, "Error applying scaling (%s)\n", av_err2str(*averr));
return NULL;
}
print_frame_summary(nc->codecctx, nc->oframe);
//print_frame_summary(nc->codecctx, nc->oframe);
#undef IMGALLOCALIGN
av_frame_unref(nc->frame);
return nc->oframe;

@ -1032,6 +1032,14 @@ blocking_write(int fd, const char* buf, size_t buflen){
}else{
written += w;
}
if(written < buflen){
struct pollfd pfd = {
.fd = fd,
.events = POLLOUT,
.revents = 0,
};
poll(&pfd, 1, -1);
}
}while(written < buflen);
return 0;
}

Loading…
Cancel
Save