Commit 0d118523 authored by minus's avatar minus

Small fixes

parent 5a66e1d5
......@@ -13,9 +13,9 @@ struct siso_watch_list sinks = {0};
static void xpa_on_sink_input_info(pa_context *ctx,
const pa_sink_input_info *info, int eol, void *userdata) {
if (!info || info->volume.channels < 1) return;
fprintf(stderr, "pa sink input: idx=%u name=%s volume=%u sink=%u mute=%i\n",
fprintf(stderr, "pa sink input: idx=%u name=%s volume=%u sink=%u mute=%i corked=%i\n",
info->index, info->name, info->volume.values[0],
info->sink, info->mute);
info->sink, info->mute, info->corked);
struct siso_watch_list *wl = userdata;
struct siso_watch *w = siso_get(wl, info->name);
if (w) {
......
......@@ -49,8 +49,8 @@ void button_sink(enum button button, enum button_direction direction, void *user
fprintf(stdout, "button pressed: %i dir=%i\n", button, direction);
if (direction != BUTTON_PRESS) return;
struct siso_watch *w = userdata;
uint32_t speakers = siso_watch_get_first_or_default(siso_get(&sinks, "speakers"), -1);
uint32_t headphones = siso_watch_get_first_or_default(siso_get(&sinks, "headphones"), -1);
uint32_t speakers = siso_watch_get_first_or_default(siso_get(&sinks, "speakers"), PA_INVALID_INDEX);
uint32_t headphones = siso_watch_get_first_or_default(siso_get(&sinks, "headphones"), PA_INVALID_INDEX);
uint32_t sink = w->target == speakers ? headphones : speakers;
xpa_sink_input_set_sink(w, sink);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment