small cleanups

This commit is contained in:
Wim Taymans 2018-05-08 10:42:17 +02:00
parent b160d81d2f
commit 7bb0e4da85
6 changed files with 25 additions and 19 deletions

View file

@ -51,7 +51,7 @@ struct spa_io_buffers {
#define SPA_STATUS_NEED_BUFFER (1<<0)
#define SPA_STATUS_HAVE_BUFFER (1<<1)
#define SPA_STATUS_FORMAT_CHANGED (1<<2)
#define SPA_STATUS_PORTS_CHANGED (1<<3)
#define SPA_STATUS_PORT_CHANGED (1<<3)
#define SPA_STATUS_PARAM_CHANGED (1<<4)
int32_t status; /**< the status code */
uint32_t buffer_id; /**< a buffer id */

View file

@ -577,10 +577,10 @@ static void alsa_on_playback_timeout_event(struct spa_source *source)
if (spa_list_is_empty(&state->ready)) {
struct spa_io_buffers *io = state->io;
if (state->filled < 128)
if (state->filled == 0)
spa_alsa_write(state, state->threshold);
else
set_timeout(state, state->threshold - 128);
set_timeout(state, state->threshold);
spa_log_trace(state->log, "alsa-util %p: %d %lu", state, io->status,
state->filled);
@ -683,7 +683,7 @@ int spa_alsa_start(struct state *state, bool xrun_recover)
if (state->started)
return 0;
spa_log_debug(state->log, "alsa %p: start", state);
spa_log_debug(state->log, "alsa %p: start %d", state, state->threshold);
CHECK(set_swparams(state), "swparams");
if (!xrun_recover)

View file

@ -23,21 +23,21 @@
#include <spa/utils/defs.h>
#define U8_MIN 0
#define U8_MAX ((1U << 8) - 1)
#define U8_SCALE ((1U << 7) - 1)
#define U8_OFFS (1U << 7)
#define U8_MAX 255
#define U8_SCALE 127
#define U8_OFFS 128
#define S16_MIN -((1U << 15) - 1)
#define S16_MAX ((1U << 15) - 1)
#define S16_SCALE ((1U << 15) - 1)
#define S16_MIN -32767
#define S16_MAX 32767
#define S16_SCALE 32767
#define S24_MIN -((1U << 23) - 1)
#define S24_MAX ((1U << 23) - 1)
#define S24_SCALE ((1U << 23) - 1)
#define S24_MIN -8388607
#define S24_MAX 8388607
#define S24_SCALE 8388607
#define S32_MIN -((1U << 31) - 1)
#define S32_MAX ((1U << 31) - 1)
#define S32_SCALE ((1U << 31) - 1)
#define S32_MIN -2147483647
#define S32_MAX 2147483647
#define S32_SCALE 2147483647
static void
conv_copy(void *data, int n_dst, void *dst[n_dst], int n_src, const void *src[n_src], int n_bytes)

View file

@ -33,6 +33,8 @@
#define M_PI_M2 ( M_PI + M_PI )
#define BUFFER_SAMPLES 48
struct type {
uint32_t prop_volume;
uint32_t io_prop_volume;
@ -282,7 +284,7 @@ static int impl_port_enum_params(struct spa_node *node,
param = spa_pod_builder_object(builder,
id, t->param_buffers.Buffers,
":", t->param_buffers.size, "iru", 32,
":", t->param_buffers.size, "iru", BUFFER_SAMPLES * sizeof(float),
SPA_POD_PROP_MIN_MAX(32, 4096),
":", t->param_buffers.stride, "i", 0,
":", t->param_buffers.buffers, "iru", 1,

View file

@ -1184,8 +1184,9 @@ do_join_graphs(struct spa_loop *loop,
in_graph = in_root->graph;
out_graph = out_root->graph;
pw_log_debug("link %p: roots %p/%p graphs %p/%p", this,
in_root, out_root, in_graph, out_graph);
pw_log_debug("link %p: roots %p/%p graphs %p/%p %d/%d", this,
in_root, out_root, in_graph, out_graph,
in_graph->flags, out_graph->flags);
if (in_graph != out_graph) {
struct spa_graph *src, *dst;

View file

@ -418,6 +418,9 @@ static void check_properties(struct pw_node *node)
SPA_FLAG_SET(impl->driver_graph.flags, SPA_GRAPH_FLAG_DRIVER);
else
SPA_FLAG_UNSET(impl->driver_graph.flags, SPA_GRAPH_FLAG_DRIVER);
pw_log_debug("node %p: graph %p driver:%d", node, &impl->driver_graph, node->driver);
}
static inline int driver_impl_finish(void *data)