+
+ if (length == 0) {
/* stream ended */
- if (buf) {
- /* this should only ever happen if the port is
-@@ -358,71 +360,72 @@ static void buffer_cb(struct vchiq_mmal_
- /* signal frame completion */
+ if (dev->capture.frame_count) {
+ /* empty buffer whilst capturing - expected to be an
+@@ -361,71 +363,72 @@ static void buffer_cb(struct vchiq_mmal_
+ vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
complete(&dev->capture.frame_cmplt);
}
- } else {
}
static int enable_camera(struct bm2835_mmal_dev *dev)
-@@ -802,27 +805,29 @@ static int vidioc_overlay(struct file *f
+@@ -815,27 +818,29 @@ static int vidioc_overlay(struct file *f
ret = vchiq_mmal_port_set_format(dev->instance, src);
if (ret < 0)