diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-09 12:11:22 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-09 12:11:22 +0100 |
commit | 03e18760a68cadaae307c72ed756973047db3ea2 (patch) | |
tree | 1d5d0b3c8c30647b76713b4fa7b343974c31d669 /test/ipedec.c | |
parent | f332137b44472905f173b0717054bd48e8cfc33f (diff) | |
download | ufodecode-03e18760a68cadaae307c72ed756973047db3ea2.tar.gz ufodecode-03e18760a68cadaae307c72ed756973047db3ea2.tar.bz2 ufodecode-03e18760a68cadaae307c72ed756973047db3ea2.tar.xz ufodecode-03e18760a68cadaae307c72ed756973047db3ea2.zip |
Adjust ipedec as well
Diffstat (limited to 'test/ipedec.c')
-rw-r--r-- | test/ipedec.c | 13 |
1 files changed, 11 insertions, 2 deletions
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) { |