pipewire/0001-Revert-v4l2-handle-inotify-errors.patch
Antonio Larrosa f8839682df Accepting request 1110285 from home:alarrosa:branches:multimedia:libs
- Add patch from upstream to fix a regression introduced in 0.3.77
  which made it fail to open a monitor device as source:
  * 0001-pulse-server-allow-monitors-when-selecting-source-by-index.patch
- Add patch from upstream to fix a bug which caused 100% cpu usage
  under some circumstances:
  * 0001-Revert-v4l2-handle-inotify-errors.patch
  * 0002-Revert-v4l2-dont-set-inotify-on-_dev.patch
  * 0003-spa-v4l2-use-a-separate-watch-for-each-device.patch

OBS-URL: https://build.opensuse.org/request/show/1110285
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pipewire?expand=0&rev=154
2023-09-11 11:02:45 +00:00

71 lines
2.0 KiB
Diff

From 1110dbb7c1a179558db72daaa099a8c23a2a1351 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= <pobrn@protonmail.com>
Date: Thu, 7 Sep 2023 01:51:10 +0200
Subject: [PATCH] Revert "v4l2: handle inotify errors"
This reverts commit 07b8954dc864ab38d69fecae0b8fd2b5c6d18251.
---
spa/plugins/v4l2/v4l2-udev.c | 32 +++++++++++++-------------------
1 file changed, 13 insertions(+), 19 deletions(-)
diff --git a/spa/plugins/v4l2/v4l2-udev.c b/spa/plugins/v4l2/v4l2-udev.c
index 464acf6fca..0fdcf165ca 100644
--- a/spa/plugins/v4l2/v4l2-udev.c
+++ b/spa/plugins/v4l2/v4l2-udev.c
@@ -393,19 +393,6 @@ static void process_device(struct impl *impl, uint32_t action, struct udev_devic
}
}
-static int stop_inotify(struct device *dev)
-{
- struct impl *impl = dev->impl;
- if (dev->notify.fd == -1)
- return 0;
- spa_log_info(impl->log, "stop inotify for /dev/video%u", dev->id);
- spa_loop_remove_source(impl->main_loop, &dev->notify);
- close(dev->notify.fd);
- dev->notify.fd = -1;
- return 0;
-}
-
-
static void impl_on_notify_events(struct spa_source *source)
{
struct device *dev = source->data;
@@ -415,12 +402,7 @@ static void impl_on_notify_events(struct spa_source *source)
struct inotify_event e; /* for appropriate alignment */
} buf;
- if (source->rmask & (SPA_IO_ERR | SPA_IO_HUP)) {
- spa_log_warn(impl->log, "notify error on /dev/video%u", dev->id);
- stop_inotify(dev);
- return;
- }
- while (source->rmask & SPA_IO_IN) {
+ while (true) {
ssize_t len;
const struct inotify_event *event;
void *p, *e;
@@ -487,6 +469,18 @@ static int start_inotify(struct device *dev)
return 0;
}
+static int stop_inotify(struct device *dev)
+{
+ struct impl *impl = dev->impl;
+ if (dev->notify.fd == -1)
+ return 0;
+ spa_log_info(impl->log, "stop inotify for /dev/video%u", dev->id);
+ spa_loop_remove_source(impl->main_loop, &dev->notify);
+ close(dev->notify.fd);
+ dev->notify.fd = -1;
+ return 0;
+}
+
static void impl_on_fd_events(struct spa_source *source)
{
struct impl *impl = source->data;
--
GitLab