mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-16 07:00:00 -05:00
improve error reporting
Move signals from core to the objects themselves Use per object info to track object signals Use periods in alsasink and source
This commit is contained in:
parent
fb69758251
commit
cae971e106
23 changed files with 573 additions and 384 deletions
|
|
@ -335,8 +335,8 @@ static void *
|
|||
connection_ensure_size (PinosConnection *conn, ConnectionBuffer *buf, size_t size)
|
||||
{
|
||||
if (buf->buffer_size + size > buf->buffer_maxsize) {
|
||||
buf->buffer_maxsize = buf->buffer_size + MAX_BUFFER_SIZE * ((size + MAX_BUFFER_SIZE-1) / MAX_BUFFER_SIZE);
|
||||
pinos_log_warn ("connection %p: resize buffer to %zd", conn, buf->buffer_maxsize);
|
||||
buf->buffer_maxsize = SPA_ROUND_UP_N (buf->buffer_size + size, MAX_BUFFER_SIZE);
|
||||
pinos_log_warn ("connection %p: resize buffer to %zd %zd %zd", conn, buf->buffer_size, size, buf->buffer_maxsize);
|
||||
buf->buffer_data = realloc (buf->buffer_data, buf->buffer_maxsize);
|
||||
}
|
||||
return (uint8_t *) buf->buffer_data + buf->buffer_size;
|
||||
|
|
@ -404,6 +404,7 @@ connection_add_error (PinosConnection *conn,
|
|||
memcpy (p, m, sizeof (PinosMessageError));
|
||||
d = p;
|
||||
|
||||
p = SPA_MEMBER (d, sizeof (PinosMessageError), void);
|
||||
if (m->error) {
|
||||
strcpy (p, m->error);
|
||||
d->error = SPA_INT_TO_PTR (SPA_PTRDIFF (p, d));
|
||||
|
|
@ -1284,6 +1285,7 @@ pinos_connection_parse_message (PinosConnection *conn,
|
|||
}
|
||||
|
||||
case PINOS_MESSAGE_INVALID:
|
||||
pinos_log_error ("invalid message %d received", conn->in.type);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -73,9 +73,6 @@ context_set_state (PinosContext *context,
|
|||
...)
|
||||
{
|
||||
if (context->state != state) {
|
||||
pinos_log_debug ("context %p: update state from %s -> %s", context,
|
||||
pinos_context_state_as_string (context->state),
|
||||
pinos_context_state_as_string (state));
|
||||
|
||||
if (context->error)
|
||||
free (context->error);
|
||||
|
|
@ -89,6 +86,10 @@ context_set_state (PinosContext *context,
|
|||
} else {
|
||||
context->error = NULL;
|
||||
}
|
||||
pinos_log_debug ("context %p: update state from %s -> %s (%s)", context,
|
||||
pinos_context_state_as_string (context->state),
|
||||
pinos_context_state_as_string (state),
|
||||
context->error);
|
||||
|
||||
context->state = state;
|
||||
pinos_signal_emit (&context->state_changed, context);
|
||||
|
|
@ -563,7 +564,7 @@ pinos_context_destroy (PinosContext *context)
|
|||
* Returns: %TRUE on success.
|
||||
*/
|
||||
bool
|
||||
pinos_context_connect (PinosContext *context)
|
||||
pinos_context_connect (PinosContext *context)
|
||||
{
|
||||
PinosContextImpl *impl = SPA_CONTAINER_OF (context, PinosContextImpl, this);
|
||||
struct sockaddr_un addr;
|
||||
|
|
|
|||
|
|
@ -865,6 +865,8 @@ pinos_stream_connect (PinosStream *stream,
|
|||
impl->node_proxy = pinos_proxy_new (stream->context,
|
||||
SPA_ID_INVALID,
|
||||
stream->context->uri.client_node);
|
||||
if (impl->node_proxy == NULL)
|
||||
return false;
|
||||
|
||||
pinos_proxy_set_dispatch (impl->node_proxy,
|
||||
stream_dispatch_func,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue