Skip to content

Commit

Permalink
prevent multiple output streams
Browse files Browse the repository at this point in the history
  • Loading branch information
IOhannes m zmölnig authored and IOhannes m zmölnig committed Apr 25, 2023
1 parent 19752a7 commit d78f95b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions v4l2loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,10 @@ static int vidioc_reqbufs(struct file *file, void *fh,
return 0;
}

if (V4L2_TYPE_IS_OUTPUT(b->type) && (!dev->ready_for_output)) {
return -EBUSY;
}

init_buffers(dev);
switch (b->memory) {
case V4L2_MEMORY_MMAP:
Expand Down

1 comment on commit d78f95b

@stephematician
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this means that once a user has called streamon, they cannot request buffers even if they have called streamoff: because ready_for_output is not set to 1 in streamoff.

Please sign in to comment.