mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-17 08:56:49 -05:00
videotestsrc: implement impl_node_set_io to fix segfault while loading
In pw_context_recalc_graph, PipeWire takes the currently configured clock target duration from the position as target rate. The position is not set for the videotestsrc since the set_io function is not implemented. This leads to a segfault when the videotestsrc is configured and loaded. Add the same dummy implementation of set_io as in the v4l2-source and the libcamera-source to prevent the segfault.
This commit is contained in:
parent
b7e863b8cf
commit
e3fb4301eb
1 changed files with 20 additions and 1 deletions
|
|
@ -89,6 +89,9 @@ struct impl {
|
||||||
struct spa_param_info params[2];
|
struct spa_param_info params[2];
|
||||||
struct props props;
|
struct props props;
|
||||||
|
|
||||||
|
struct spa_io_clock *clock;
|
||||||
|
struct spa_io_position *position;
|
||||||
|
|
||||||
struct spa_hook_list hooks;
|
struct spa_hook_list hooks;
|
||||||
struct spa_callbacks callbacks;
|
struct spa_callbacks callbacks;
|
||||||
|
|
||||||
|
|
@ -196,7 +199,23 @@ static int impl_node_enum_params(void *object, int seq,
|
||||||
|
|
||||||
static int impl_node_set_io(void *object, uint32_t id, void *data, size_t size)
|
static int impl_node_set_io(void *object, uint32_t id, void *data, size_t size)
|
||||||
{
|
{
|
||||||
return -ENOTSUP;
|
struct impl *this = object;
|
||||||
|
|
||||||
|
spa_return_val_if_fail(this != NULL, -EINVAL);
|
||||||
|
|
||||||
|
switch (id) {
|
||||||
|
case SPA_IO_Clock:
|
||||||
|
if (size > 0 && size < sizeof(struct spa_io_clock))
|
||||||
|
return -EINVAL;
|
||||||
|
this->clock = data;
|
||||||
|
break;
|
||||||
|
case SPA_IO_Position:
|
||||||
|
this->position = data;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return -ENOENT;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
|
static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue