From 5e3a9d314c04a5fe40583c66ee3734dd9511098a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Solveig=20Hafl=C3=ADnud=C3=B3ttir?= Date: Mon, 14 Nov 2022 14:23:17 +0000 Subject: nusb/cam: rather than showing partially green frames (when not enough bandwidth), skip those altogether --- sys/src/cmd/nusb/cam/video.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sys/src/cmd/nusb') 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); -- cgit v1.2.3