summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stream/tvi_v4l2.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c
index f339b83439..2a2dae76ba 100644
--- a/stream/tvi_v4l2.c
+++ b/stream/tvi_v4l2.c
@@ -1012,11 +1012,13 @@ static int uninit(priv_t *priv)
}
priv->streamon = 0;
- /* unqueue all remaining buffers */
- memset(&buf,0,sizeof(buf));
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- buf.memory = V4L2_MEMORY_MMAP;
- while (!v4l2_ioctl(priv->video_fd, VIDIOC_DQBUF, &buf));
+ /* unqueue all remaining buffers (not sure if this code is correct) */
+ for (i = 0; i < priv->mapcount; i++) {
+ if (v4l2_ioctl(priv->video_fd, VIDIOC_DQBUF, &priv->map[i].buf) < 0) {
+ MP_ERR(priv, "%s: VIDIOC_DQBUF failed: %s\n",
+ info.short_name, strerror(errno));
+ }
+ }
}
/* unmap all buffers */