diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2012-02-10 15:34:37 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2012-02-10 15:34:37 +0100 |
commit | 3cb96411dbb31caf286382e2a108704440b2894a (patch) | |
tree | 314bcbfe74c67a34b72147410a6c8b9e56d45bbc /test | |
parent | abe088c58aeb876d1471fa99e0fc5c1d85cb1403 (diff) | |
parent | 0b5e739674f26ddc97e92cad9bb8239f9617c3f2 (diff) | |
download | libufodecode-3cb96411dbb31caf286382e2a108704440b2894a.tar.gz libufodecode-3cb96411dbb31caf286382e2a108704440b2894a.tar.bz2 libufodecode-3cb96411dbb31caf286382e2a108704440b2894a.tar.xz libufodecode-3cb96411dbb31caf286382e2a108704440b2894a.zip |
Merge
Diffstat (limited to 'test')
-rw-r--r-- | test/ipedec.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/ipedec.c b/test/ipedec.c index f14498d..c6bf4ee 100644 --- a/test/ipedec.c +++ b/test/ipedec.c @@ -51,7 +51,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; @@ -59,12 +59,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) { |