mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
v4l2: Check device node
Check the device node on init. Only remove the source once
This commit is contained in:
parent
43e3ecdb3b
commit
91a10d7c9e
2 changed files with 9 additions and 3 deletions
|
|
@ -993,6 +993,7 @@ impl_init(const struct spa_handle_factory *factory,
|
|||
uint32_t i;
|
||||
const char *str;
|
||||
struct port *port;
|
||||
int res;
|
||||
|
||||
spa_return_val_if_fail(factory != NULL, -EINVAL);
|
||||
spa_return_val_if_fail(handle != NULL, -EINVAL);
|
||||
|
|
@ -1042,6 +1043,9 @@ impl_init(const struct spa_handle_factory *factory,
|
|||
|
||||
if (info && (str = spa_dict_lookup(info, "device.path"))) {
|
||||
strncpy(this->props.device, str, 63);
|
||||
if ((res = spa_v4l2_open(this)) < 0)
|
||||
return res;
|
||||
spa_v4l2_close(this);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue