ref: 5e3a9d314c04a5fe40583c66ee3734dd9511098a
parent: 67420a0bf6dd027538d6c98fc4bba9a05dc34efa
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Nov 14 09:23:17 EST 2022
nusb/cam: rather than showing partially green frames (when not enough bandwidth), skip those altogether
--- a/sys/src/cmd/nusb/cam/video.c
+++ b/sys/src/cmd/nusb/cam/video.c
@@ -161,10 +161,8 @@
rc = read(c->ep->dfd, buf, sizeof(buf));
if(c->abort || rc < 0) break;
if(rc == 0) continue;
- if(((ob ^ buf[1]) & 1) != 0 && bufn != 0){
- if(!c->framemode || bufn == frsz){
- if(bufn < frsz)
- memset(fbuf + bufn, 0, frsz - bufn);
+ if((ob ^ buf[1]) & 1){
+ if(bufn == frsz){
of = grabframe(c);
cvt->fn(f, g, fbuf, of);
pushframe(c, of);