summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2017-04-04 22:54:34 +0200
committerMarcus Meissner <marcus@jet.franken.de>2017-04-04 22:54:34 +0200
commit7076ea6522c0f9557663b2a461c6e951b6764c15 (patch)
tree1d78d906a5510f0414e635ee52f0f4797c8f76de
parentf1f9063d359db5565676bc58a32721ee483a18fc (diff)
downloadlibgphoto2-7076ea6522c0f9557663b2a461c6e951b6764c15.tar.gz
wait after delete
try to return the same id for the capt images on raw and jpg
-rw-r--r--camlibs/pentax/library.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/camlibs/pentax/library.c b/camlibs/pentax/library.c
index cdb675427..4e3bbff40 100644
--- a/camlibs/pentax/library.c
+++ b/camlibs/pentax/library.c
@@ -290,7 +290,7 @@ camera_capture (Camera *camera, CameraCaptureType type, CameraFilePath *path,
buftypes[1] = status.jpeg_quality + 1;
jpegres[1] = status.jpeg_resolution;
mimes[1] = GP_MIME_JPEG;
- sprintf (path->name, "capt%04d.jpg", capcnt++);
+ sprintf (path->name, "capt%04d.jpg", capcnt);
fns[1] = strdup(path->name);
camera->pl->lastfn = strdup (fns[1]);
nrofdownloads = 2;
@@ -373,6 +373,8 @@ camera_capture (Camera *camera, CameraCaptureType type, CameraFilePath *path,
}
pslr_delete_buffer(p, bufno );
+ pslr_get_status (&camera->pl->pslr, &status); /* wait until busy is gone */
+
return ret;
}
@@ -448,7 +450,7 @@ camera_wait_for_event (Camera *camera, int timeout,
buftypes[1] = status.jpeg_quality + 1;
jpegres[1] = status.jpeg_resolution;
nrofdownloads = 2;
- sprintf (path->name, "capt%04d.jpg", capcnt++);
+ sprintf (path->name, "capt%04d.jpg", capcnt);
fns[1] = strdup (path->name);
/* we pass back the secondary file via the private struct, and return the first */
camera->pl->lastfn = strdup (fns[1]);
@@ -520,6 +522,8 @@ camera_wait_for_event (Camera *camera, int timeout,
free (fns[i]);
}
pslr_delete_buffer (p, bufno);
+ pslr_get_status (&camera->pl->pslr, &status); /* wait until busy is gone */
+
*eventtype = GP_EVENT_FILE_ADDED;
*eventdata = path;
return GP_OK;