mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pulse-server: index flags are only used for modules
one flag for the internal extension modules, another flag for the modules we load in pulse server that don't really have a matching pipewire module.
This commit is contained in:
parent
6a2aea8e0a
commit
955e4287ab
4 changed files with 9 additions and 9 deletions
|
|
@ -56,9 +56,9 @@
|
|||
|
||||
#define SCACHE_ENTRY_SIZE_MAX (1024*1024*16)
|
||||
|
||||
#define INDEX_MASK 0xffffffu
|
||||
#define EXTENSION_FLAG (1u << 25)
|
||||
#define MODULE_FLAG (1u << 26)
|
||||
#define MODULE_INDEX_MASK 0xfffffffu
|
||||
#define MODULE_EXTENSION_FLAG (1u << 28)
|
||||
#define MODULE_FLAG (1u << 29)
|
||||
|
||||
#define DEFAULT_SINK "@DEFAULT_SINK@"
|
||||
#define DEFAULT_SOURCE "@DEFAULT_SOURCE@"
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@
|
|||
#include "extensions/registry.h"
|
||||
|
||||
static const struct extension extensions[] = {
|
||||
{ "module-stream-restore", 0 | EXTENSION_FLAG, do_extension_stream_restore, },
|
||||
{ "module-device-restore", 1 | EXTENSION_FLAG, do_extension_device_restore, },
|
||||
{ "module-device-manager", 2 | EXTENSION_FLAG, do_extension_device_manager, },
|
||||
{ "module-stream-restore", 0 | MODULE_EXTENSION_FLAG, do_extension_stream_restore, },
|
||||
{ "module-device-restore", 1 | MODULE_EXTENSION_FLAG, do_extension_device_restore, },
|
||||
{ "module-device-manager", 2 | MODULE_EXTENSION_FLAG, do_extension_device_manager, },
|
||||
};
|
||||
|
||||
const struct extension *extension_find(uint32_t idx, const char *name)
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ void module_free(struct module *module)
|
|||
module_emit_destroy(module);
|
||||
|
||||
if (module->idx != SPA_ID_INVALID)
|
||||
pw_map_remove(&impl->modules, module->idx & INDEX_MASK);
|
||||
pw_map_remove(&impl->modules, module->idx & MODULE_INDEX_MASK);
|
||||
|
||||
spa_hook_list_clean(&module->listener_list);
|
||||
pw_work_queue_cancel(impl->work_queue, module, SPA_ID_INVALID);
|
||||
|
|
|
|||
|
|
@ -4015,7 +4015,7 @@ static int do_get_info(struct client *client, uint32_t command, uint32_t tag, st
|
|||
|
||||
if (command == COMMAND_GET_MODULE_INFO && (sel.id & MODULE_FLAG) != 0) {
|
||||
struct module *module;
|
||||
module = pw_map_lookup(&impl->modules, sel.id & INDEX_MASK);
|
||||
module = pw_map_lookup(&impl->modules, sel.id & MODULE_INDEX_MASK);
|
||||
if (module == NULL)
|
||||
goto error_noentity;
|
||||
fill_ext_module_info(client, reply, module);
|
||||
|
|
@ -4772,7 +4772,7 @@ static int do_unload_module(struct client *client, uint32_t command, uint32_t ta
|
|||
if ((module_idx & MODULE_FLAG) == 0)
|
||||
return -EPERM;
|
||||
|
||||
module = pw_map_lookup(&impl->modules, module_idx & INDEX_MASK);
|
||||
module = pw_map_lookup(&impl->modules, module_idx & MODULE_INDEX_MASK);
|
||||
if (module == NULL)
|
||||
return -ENOENT;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue