After the first capture ->num_frames never got to be _equal_
to ->limit_frames; fixed by resetting to zero in dev_acquisition_stop(),
and protected against similar problems in the future by switching to
greater-or-equal instead.
packet.type = SR_DF_FRAME_END;
sr_session_send(sdi, &packet);
- if (devc->limit_frames && ++devc->num_frames == devc->limit_frames) {
+ if (devc->limit_frames && ++devc->num_frames >= devc->limit_frames) {
/* Terminate session */
devc->dev_state = STOPPING;
} else {
devc = sdi->priv;
devc->dev_state = STOPPING;
+ devc->num_frames = 0;
return SR_OK;
}