mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
small cleanups
This commit is contained in:
parent
0f6b3a7cab
commit
6b2d77e64d
2 changed files with 9 additions and 9 deletions
|
|
@ -148,15 +148,15 @@ connection_data(struct spa_loop_utils *utils,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (opcode >= resource->iface->n_methods) {
|
if (opcode >= resource->iface->n_methods) {
|
||||||
pw_log_error("protocol-native %p: invalid method %u", client->impl,
|
pw_log_error("protocol-native %p: invalid method %u %u", client->impl,
|
||||||
opcode);
|
id, opcode);
|
||||||
client_destroy(client);
|
client_destroy(client);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
demarshal = resource->iface->methods;
|
demarshal = resource->iface->methods;
|
||||||
if (!demarshal[opcode] || !demarshal[opcode] (resource, message, size)) {
|
if (!demarshal[opcode] || !demarshal[opcode] (resource, message, size)) {
|
||||||
pw_log_error("protocol-native %p: invalid message received",
|
pw_log_error("protocol-native %p: invalid message received %u %u",
|
||||||
client->impl);
|
client->impl, id, opcode);
|
||||||
client_destroy(client);
|
client_destroy(client);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,7 @@ extern "C" {
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
enum {
|
enum spa_result {
|
||||||
SPA_RESULT_ASYNC = (1 << 30),
|
|
||||||
SPA_RESULT_WAIT_SYNC = 2,
|
SPA_RESULT_WAIT_SYNC = 2,
|
||||||
SPA_RESULT_MODIFIED = 1,
|
SPA_RESULT_MODIFIED = 1,
|
||||||
SPA_RESULT_OK = 0,
|
SPA_RESULT_OK = 0,
|
||||||
|
|
@ -73,15 +72,16 @@ enum {
|
||||||
SPA_RESULT_INCOMPATIBLE_PROPS = -36,
|
SPA_RESULT_INCOMPATIBLE_PROPS = -36,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define SPA_ASYNC_BIT (1 << 30)
|
||||||
#define SPA_ASYNC_MASK (3 << 30)
|
#define SPA_ASYNC_MASK (3 << 30)
|
||||||
#define SPA_ASYNC_SEQ_MASK (SPA_RESULT_ASYNC - 1)
|
#define SPA_ASYNC_SEQ_MASK (SPA_ASYNC_BIT - 1)
|
||||||
|
|
||||||
#define SPA_RESULT_IS_OK(res) ((res) >= 0)
|
#define SPA_RESULT_IS_OK(res) ((res) >= 0)
|
||||||
#define SPA_RESULT_IS_ERROR(res) ((res) < 0)
|
#define SPA_RESULT_IS_ERROR(res) ((res) < 0)
|
||||||
#define SPA_RESULT_IS_ASYNC(res) (((res) & SPA_ASYNC_MASK) == SPA_RESULT_ASYNC)
|
#define SPA_RESULT_IS_ASYNC(res) (((res) & SPA_ASYNC_MASK) == SPA_ASYNC_BIT)
|
||||||
|
|
||||||
#define SPA_RESULT_ASYNC_SEQ(res) ((res) & SPA_ASYNC_SEQ_MASK)
|
#define SPA_RESULT_ASYNC_SEQ(res) ((res) & SPA_ASYNC_SEQ_MASK)
|
||||||
#define SPA_RESULT_RETURN_ASYNC(seq) (SPA_RESULT_ASYNC | ((seq) & SPA_ASYNC_SEQ_MASK))
|
#define SPA_RESULT_RETURN_ASYNC(seq) (SPA_ASYNC_BIT | ((seq) & SPA_ASYNC_SEQ_MASK))
|
||||||
|
|
||||||
enum spa_direction {
|
enum spa_direction {
|
||||||
SPA_DIRECTION_INPUT = 0,
|
SPA_DIRECTION_INPUT = 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue