From b640dfad6fd5c0ae3a9bfdd9b4bd54e387b0cc51 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 6 Aug 2017 02:52:29 +0200 Subject: Update blind-convert to support unconverted output from ffmpeg and partially converted output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blind-single-colour.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/blind-single-colour.c') diff --git a/src/blind-single-colour.c b/src/blind-single-colour.c index 567a7f5..92a8289 100644 --- a/src/blind-single-colour.c +++ b/src/blind-single-colour.c @@ -77,8 +77,7 @@ PROCESS(void) { typedef TYPE pixel_t[4]; pixel_t buf[BUFSIZ / 4]; - size_t x, y, n; - ssize_t r; + size_t x, y, n, r; for (x = 0; x < ELEMENTSOF(buf); x++) { buf[x][0] = (TYPE)X; buf[x][1] = (TYPE)Y; @@ -88,7 +87,7 @@ PROCESS(void) while (inf || stream.frames--) for (y = stream.height; y--;) for (x = stream.width * sizeof(*buf); x;) - for (x -= n = MIN(sizeof(buf), x); n; n -= (size_t)r) + for (x -= n = MIN(sizeof(buf), x); n; n -= r) r = ewrite(STDOUT_FILENO, buf, n, ""); } -- cgit v1.2.3-70-g09d2