From 938c0600e591c42bdf4315059c6c07e61eacd50c Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Sat, 22 Oct 2011 13:41:54 +0200 Subject: interface: Dont move a sink_input if there is only one sink --- src/interface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/interface.c b/src/interface.c index 6822f14..371de34 100644 --- a/src/interface.c +++ b/src/interface.c @@ -357,11 +357,14 @@ interface_get_input(GIOChannel *source, GIOCondition condition, gpointer data) case '\n': case '\t': case ' ': - if (ctx->chooser_input == SELECTED_SINK) + if (ctx->chooser_input == SELECTED_SINK || + ctx->chooser_input == SELECTED_UNKNOWN) break; sink = g_list_nth_data(ctx->sink_list, ctx->chooser_sink); sink_input_info *input = sink_get_nth_input(ctx, sink, ctx->chooser_input); + if (g_list_length(ctx->sink_list) <= 1) + break; ctx->selected_index = input->index; if (ctx->chooser_sink < (gint)g_list_length(ctx->sink_list) - 1) ctx->chooser_sink++; -- cgit