void-packages/srcpkgs/v4l2loopback/patches/0001-Backport-PR-477-1.patch

38 lines
1.2 KiB
Diff

From 3407c4262b1d72307a8106008874c112de1e3549 Mon Sep 17 00:00:00 2001
From: Rodrigo Oliveira <mdkcore@qtrnn.io>
Date: Thu, 20 Oct 2022 18:41:43 -0300
Subject: [PATCH 1/2] Backport PR #477 [1]
[1] https://github.com/umlaeute/v4l2loopback/pull/477/commits/3312a6d0461d6d2d82a411f26c34e380bd3cee27
---
v4l2loopback.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/v4l2loopback.c b/v4l2loopback.c
index 7e47a43..22e9795 100644
--- a/v4l2loopback.c
+++ b/v4l2loopback.c
@@ -2038,15 +2038,17 @@ static ssize_t v4l2_loopback_read(struct file *file, char __user *buf,
static ssize_t v4l2_loopback_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
+ struct v4l2_loopback_opener *opener;
struct v4l2_loopback_device *dev;
int write_index;
struct v4l2_buffer *b;
MARK();
dev = v4l2loopback_getdevice(file);
+ opener = fh_to_opener(file->private_data);
- /* there's at least one writer, so don'stop announcing output capabilities */
- dev->ready_for_output = 0;
+ if (WRITER != opener->type)
+ return -EINVAL;
if (!dev->ready_for_capture) {
int ret = allocate_buffers(dev);
--
2.38.1