Skip to content

Commit

Permalink
Make sure to only disable frame rate if necessary.
Browse files Browse the repository at this point in the history
Previously irrespective of whether a trigger was set or not the frame
rate was tried to be disabled. However, this failed if already a
trigger was set, causing the whole set_trigger call to fail.

This also fixes a bug where the wrong error pointer was checked in
arv_camera_get_frame_rate_enable.
  • Loading branch information
feuerste committed Mar 11, 2024
1 parent b09b4ed commit dda7d61
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/arvcamera.c
Original file line number Diff line number Diff line change
Expand Up @@ -1377,12 +1377,8 @@ gboolean arv_camera_get_frame_rate_enable(ArvCamera* camera, GError** error)
case ARV_CAMERA_VENDOR_MATRIX_VISION:
case ARV_CAMERA_VENDOR_IMPERX:
case ARV_CAMERA_VENDOR_UNKNOWN:
if (arv_camera_is_feature_available(camera, "AcquisitionFrameRateEnable", error))
if (arv_camera_is_feature_available(camera, "AcquisitionFrameRateEnable", NULL))
{
if (error != NULL)
{
return TRUE;
}
return arv_camera_get_boolean(camera, "AcquisitionFrameRateEnable", error);
}
case ARV_CAMERA_VENDOR_PROSILICA:
Expand Down Expand Up @@ -1424,7 +1420,11 @@ arv_camera_set_trigger (ArvCamera *camera, const char *source, GError **error)
g_return_if_fail (ARV_IS_CAMERA (camera));
g_return_if_fail (source != NULL);

arv_camera_set_frame_rate_enable (camera, FALSE, &local_error);
if (arv_camera_get_frame_rate_enable(camera, &local_error)) {
if (local_error == NULL) {
arv_camera_set_frame_rate_enable (camera, FALSE, &local_error);
}
}

if (local_error == NULL) {
has_trigger_selector = arv_camera_is_feature_available(camera, "TriggerSelector", &local_error);
Expand Down

0 comments on commit dda7d61

Please sign in to comment.