From df2c62d675aff46d1188b7079e866276ec88aa2e Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 17 Apr 2012 09:06:34 +0200 Subject: Decode frames after encountering corrupted ones --- test/ipedec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/ipedec.c b/test/ipedec.c index ad982ef..cbc5c25 100644 --- a/test/ipedec.c +++ b/test/ipedec.c @@ -56,7 +56,7 @@ static void process_file(const char *filename, int rows, int clear_frame) int error = read_raw_file(filename, &buffer, &num_bytes); if (error) { - fprintf(stderr, "Error processing %s: %s\n", filename, strerror(error)); + fprintf(stderr, "Error reading %s: %s\n", filename, strerror(error)); return; } @@ -76,7 +76,7 @@ static void process_file(const char *filename, int rows, int clear_frame) return; } - while (!err) { + while (err != EIO) { if (clear_frame) memset(pixels, 0, 2048 * 1088 * sizeof(uint16_t)); @@ -90,6 +90,8 @@ static void process_file(const char *filename, int rows, int clear_frame) useconds += end.tv_usec - start.tv_usec; fwrite(pixels, sizeof(uint16_t), 2048 * 1088, fp); } + else if (err != EIO) + fprintf(stderr, "Failed to decode frame %i\n", num_frames); } fclose(fp); -- cgit v1.2.3