diff options
author | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2012-04-13 15:07:45 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2012-04-13 15:07:45 +0200 |
commit | fd45b7181c42d5edc2d5753c32d5b6f48bd98cac (patch) | |
tree | 68393278f19c36536ad711ad2e9fbf903b527a8f /test/grab.c | |
parent | 9416704d1b8d3ebdf1dbab14918287cd5f17d351 (diff) | |
download | libuca-fd45b7181c42d5edc2d5753c32d5b6f48bd98cac.tar.gz libuca-fd45b7181c42d5edc2d5753c32d5b6f48bd98cac.tar.bz2 libuca-fd45b7181c42d5edc2d5753c32d5b6f48bd98cac.tar.xz libuca-fd45b7181c42d5edc2d5753c32d5b6f48bd98cac.zip |
Fix multiple recordings
Diffstat (limited to 'test/grab.c')
-rw-r--r-- | test/grab.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/grab.c b/test/grab.c index 7b5062f..bcabd1a 100644 --- a/test/grab.c +++ b/test/grab.c @@ -65,11 +65,13 @@ int main(int argc, char *argv[]) uca_camera_start_recording(camera, &error); g_assert_no_error(error); - while (counter < 4) { + while (counter < 2) { g_print(" grab frame ... "); uca_camera_grab(camera, &buffer, &error); - if (error != NULL) - break; + if (error != NULL) { + g_print("\nError: %s\n", error->message); + goto cleanup; + } g_print("done\n"); snprintf(filename, FILENAME_MAX, "frame-%08i.raw", counter++); @@ -78,11 +80,13 @@ int main(int argc, char *argv[]) fclose(fp); } - g_print("Start recording\n"); + g_print("Stop recording\n"); uca_camera_stop_recording(camera, &error); g_assert_no_error(error); } +cleanup: + uca_camera_stop_recording(camera, NULL); g_object_unref(camera); g_free(buffer); |