diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-10-22 13:41:54 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-10-22 13:41:54 +0200 |
commit | 938c0600e591c42bdf4315059c6c07e61eacd50c (patch) | |
tree | 9af71d83710c60d5709ea3a5da481b9423589aca /src | |
parent | 3ff60f329783eae9471f002ecec328920f72852a (diff) | |
download | pa-sink-ctl-938c0600e591c42bdf4315059c6c07e61eacd50c.tar.gz pa-sink-ctl-938c0600e591c42bdf4315059c6c07e61eacd50c.tar.bz2 pa-sink-ctl-938c0600e591c42bdf4315059c6c07e61eacd50c.zip |
interface: Dont move a sink_input if there is only one sink
Diffstat (limited to 'src')
-rw-r--r-- | src/interface.c | 5 |
1 files changed, 4 insertions, 1 deletions
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++; |