From 03e18760a68cadaae307c72ed756973047db3ea2 Mon Sep 17 00:00:00 2001
From: "Suren A. Chilingaryan" <csa@dside.dyndns.org>
Date: Fri, 9 Dec 2011 12:11:22 +0100
Subject: Adjust ipedec as well

---
 test/ipedec.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

(limited to 'test/ipedec.c')

diff --git a/test/ipedec.c b/test/ipedec.c
index 94c8d59..22d71bc 100644
--- a/test/ipedec.c
+++ b/test/ipedec.c
@@ -47,7 +47,7 @@ int main(int argc, char const* argv[])
 
     const int rows = atoi(argv[2]);
 
-    ufo_decoder decoder = ufo_decoder_new(rows, (uint32_t *) buffer, num_bytes);
+    ufo_decoder decoder = ufo_decoder_new(rows, 2048, (uint32_t *) buffer, num_bytes);
     int err = 0;
     uint16_t *pixels = (uint16_t *) malloc(2048 * rows * sizeof(uint16_t));
     uint32_t frame_number, time_stamp;
@@ -55,11 +55,20 @@ int main(int argc, char const* argv[])
     struct timeval start, end;
     long seconds = 0L, useconds = 0L;
 
+    if (!decoder) {
+	fprintf(stderr, "Failed to initialize decoder\n");
+	return EXIT_FAILURE;
+    }
+
     FILE *fp = fopen("test.raw", "wb");
+    if (!fp) {
+	fprintf(stderr, "Failed to open file for writting\n");
+	return EXIT_FAILURE;
+    }
 
     while (!err) {
         gettimeofday(&start, NULL);
-        err = ufo_decoder_get_next_frame(decoder, &pixels, &frame_number, &time_stamp);
+        err = ufo_decoder_get_next_frame(decoder, &pixels, &frame_number, &time_stamp, NULL);
         gettimeofday(&end, NULL);
 
         if (!err) {
-- 
cgit v1.2.3