mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
spa: v4l2: handle IN_IGNORED events from inotify
This commit is contained in:
parent
69f9e75458
commit
0158b5dcb6
1 changed files with 12 additions and 9 deletions
|
|
@ -441,8 +441,6 @@ static void impl_on_notify_events(struct spa_source *source)
|
||||||
for (p = &buf; p < e;
|
for (p = &buf; p < e;
|
||||||
p = SPA_PTROFF(p, sizeof(struct inotify_event) + event->len, void)) {
|
p = SPA_PTROFF(p, sizeof(struct inotify_event) + event->len, void)) {
|
||||||
event = (const struct inotify_event *) p;
|
event = (const struct inotify_event *) p;
|
||||||
|
|
||||||
if ((event->mask & IN_ATTRIB)) {
|
|
||||||
struct device *device = NULL;
|
struct device *device = NULL;
|
||||||
|
|
||||||
for (size_t i = 0; i < this->n_devices; i++) {
|
for (size_t i = 0; i < this->n_devices; i++) {
|
||||||
|
|
@ -452,14 +450,19 @@ static void impl_on_notify_events(struct spa_source *source)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
spa_assert(device);
|
if (!device)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (event->mask & IN_ATTRIB) {
|
||||||
bool access = check_access(this, device);
|
bool access = check_access(this, device);
|
||||||
if (access && !device->emitted)
|
if (access && !device->emitted)
|
||||||
process_device(this, ACTION_ADD, device);
|
process_device(this, ACTION_ADD, device);
|
||||||
else if (!access && device->emitted)
|
else if (!access && device->emitted)
|
||||||
process_device(this, ACTION_DISABLE, device);
|
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