diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-01-14 04:40:03 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-01-14 04:40:03 +0100 |
| commit | a2dfbb3368ce0e998f774dd294383772651d1302 (patch) | |
| tree | 094dbc3206297d3b3b0d090daff426ce66ea45f7 /src/stream.c | |
| parent | Rename to blind (diff) | |
| download | blind-a2dfbb3368ce0e998f774dd294383772651d1302.tar.gz blind-a2dfbb3368ce0e998f774dd294383772651d1302.tar.bz2 blind-a2dfbb3368ce0e998f774dd294383772651d1302.tar.xz | |
Fix errors, blind-{to,from}-{video,image} works
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/stream.c')
| -rw-r--r-- | src/stream.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/stream.c b/src/stream.c index edee6a7..a6e9692 100644 --- a/src/stream.c +++ b/src/stream.c @@ -17,7 +17,7 @@ eninit_stream(int status, struct stream *stream) size_t n; char *p = NULL, *w, *h, *f, *end; - for (stream->ptr = 0; stream->fd >= 0 && p;) { + for (stream->ptr = 0; stream->fd >= 0 && !p;) { r = read(stream->fd, stream->buf + stream->ptr, sizeof(stream->buf) - stream->ptr); if (r < 0) enprintf(status, "read %s:", stream->file); @@ -87,7 +87,7 @@ eninit_stream(int status, struct stream *stream) return; bad_format: - enprintf(status, "%s: file format not supported%s\n", stream->file); + enprintf(status, "%s: file format not supported\n", stream->file); } @@ -167,9 +167,9 @@ void encheck_compat(int status, const struct stream *a, const struct stream *b) { if (a->width != b->width || a->height != b->height) - eprintf("videos do not have the same geometry\n"); + enprintf(status, "videos do not have the same geometry\n"); if (strcmp(a->pixfmt, b->pixfmt)) - eprintf("videos use incompatible pixel formats\n"); + enprintf(status, "videos use incompatible pixel formats\n"); } @@ -181,11 +181,11 @@ enread_frame(int status, struct stream *stream, void *buf, size_t n) for (; stream->ptr < n; stream->ptr += (size_t)r) { r = read(stream->fd, buffer + stream->ptr, n - stream->ptr); if (r < 0) { - eprintf("read %s:", stream->file); + enprintf(status, "read %s:", stream->file); } else if (r == 0) { if (!stream->ptr) break; - eprintf("%s: incomplete frame", stream->file); + enprintf(status, "%s: incomplete frame", stream->file); } } if (!stream->ptr) |
