ref: 7bdda1ff148fbe5823875ee205a4e3e7868ada2f
parent: d0c19101cf042a0c4e3e611fc606f32e1c4ae451
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Thu Aug 12 08:44:45 EDT 2021
fix flush on note and remove fps printout
--- a/hj264.c
+++ b/hj264.c
@@ -20,7 +20,6 @@
Align = 64,
Maxquality = 10,
-
TimedenumIVF = 1000ULL,
};
@@ -318,29 +317,18 @@
}
static int
-done(void *, char *msg)
+done(void *, char *)
{
- uvlong s;
Hj264 *h;
- if(debug){
- s = npe_nanosec() - tstart;
- s /= Nsec;
- if(s != 0)
- fprint(2, "%llud fps\n", nframes / s);
+ if((h = *procdata()) != nil){
+ chanclose(h->frame);
+ recvp(h->done);
}
- h = *procdata();
- Bflush(&h->out);
- threadexitsall(msg);
+
return 1;
}
-static int
-pipeignore(void *, char *s)
-{
- return strncmp(s, "sys: write", 10) == 0 ? 1 : 0;
-}
-
int
main(int argc, char **argv)
{
@@ -441,8 +429,7 @@
h->rp.desired_frame_bytes = kbps*1000/8/fps;
}
*procdata() = h;
- threadnotify(done, 1);
- atnotify(pipeignore, 1);
+ atnotify(done, 1);
procrfork(encthread, h, mainstacksize, RFCENVG);
if(h->fmt == FmtIVF){
@@ -461,7 +448,8 @@
v[11] = 0;
memset(v+12, 0, 8); /* unknown duration */
Bwrite(&h->out, v, sizeof(v));
- Bflush(&h->out);
+ if(Bflush(&h->out) != 0)
+ return -1;
}
tstart = nsec() - npe_nanosec();