mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
libcamera: Fixed the crash issue when rtkit is enabled.
This commit is contained in:
parent
2c70106728
commit
40ef322a34
4 changed files with 46 additions and 32 deletions
|
|
@ -134,9 +134,11 @@ struct port {
|
|||
struct impl {
|
||||
struct spa_handle handle;
|
||||
struct spa_node node;
|
||||
bool have_source;
|
||||
|
||||
struct spa_log *log;
|
||||
struct spa_loop *data_loop;
|
||||
struct spa_system *system;
|
||||
|
||||
uint64_t info_all;
|
||||
struct spa_node_info info;
|
||||
|
|
@ -901,7 +903,10 @@ static int impl_clear(struct spa_handle *handle)
|
|||
free(port->dev.camera);
|
||||
port->dev.camera = NULL;
|
||||
}
|
||||
|
||||
if(this->have_source) {
|
||||
spa_system_close(this->system, port->source.fd);
|
||||
this->have_source = false;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -935,12 +940,18 @@ impl_init(const struct spa_handle_factory *factory,
|
|||
|
||||
this->log = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_Log);
|
||||
this->data_loop = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_DataLoop);
|
||||
this->system = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_System);
|
||||
|
||||
if (this->data_loop == NULL) {
|
||||
spa_log_error(this->log, "a data_loop is needed");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (this->system == NULL) {
|
||||
spa_log_error(this->log, "a system is needed");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
this->node.iface = SPA_INTERFACE_INIT(
|
||||
SPA_TYPE_INTERFACE_Node,
|
||||
SPA_VERSION_NODE,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue