summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorSigrid Solveig Haflínudóttir <sigrid@ftrv.se>2022-11-14 14:23:17 +0000
committerSigrid Solveig Haflínudóttir <sigrid@ftrv.se>2022-11-14 14:23:17 +0000
commit5e3a9d314c04a5fe40583c66ee3734dd9511098a (patch)
tree424eac90bac339eaab8230a3a22dccb5e087a1e4 /sys
parent67420a0bf6dd027538d6c98fc4bba9a05dc34efa (diff)
nusb/cam: rather than showing partially green frames (when not enough bandwidth), skip those altogether
Diffstat (limited to 'sys')
-rw-r--r--sys/src/cmd/nusb/cam/video.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/src/cmd/nusb/cam/video.c b/sys/src/cmd/nusb/cam/video.c
index bd971dc0e..518b5d50d 100644
--- a/sys/src/cmd/nusb/cam/video.c
+++ b/sys/src/cmd/nusb/cam/video.c
@@ -161,10 +161,8 @@ cvtproc(void *v)
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);