mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: v4l2: handle IN_IGNORED events from inotify
(cherry picked from commit 0158b5dcb6)
This commit is contained in:
parent
e19d9784cf
commit
37031a21ea
1 changed files with 12 additions and 9 deletions
|
|
@ -441,25 +441,28 @@ static void impl_on_notify_events(struct spa_source *source)
|
|||
for (p = &buf; p < e;
|
||||
p = SPA_PTROFF(p, sizeof(struct inotify_event) + event->len, void)) {
|
||||
event = (const struct inotify_event *) p;
|
||||
struct device *device = NULL;
|
||||
|
||||
if ((event->mask & IN_ATTRIB)) {
|
||||
struct device *device = NULL;
|
||||
|
||||
for (size_t i = 0; i < this->n_devices; i++) {
|
||||
if (this->devices[i].inotify_wd == event->wd) {
|
||||
device = &this->devices[i];
|
||||
break;
|
||||
}
|
||||
for (size_t i = 0; i < this->n_devices; i++) {
|
||||
if (this->devices[i].inotify_wd == event->wd) {
|
||||
device = &this->devices[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
spa_assert(device);
|
||||
if (!device)
|
||||
continue;
|
||||
|
||||
if (event->mask & IN_ATTRIB) {
|
||||
bool access = check_access(this, device);
|
||||
if (access && !device->emitted)
|
||||
process_device(this, ACTION_ADD, device);
|
||||
else if (!access && device->emitted)
|
||||
process_device(this, ACTION_DISABLE, device);
|
||||
}
|
||||
|
||||
if (event->mask & IN_IGNORED)
|
||||
device->inotify_wd = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue