diff options
author | Jan Klemkow <web2p10@wemelug.de> | 2010-07-02 14:48:42 +0200 |
---|---|---|
committer | Jan Klemkow <web2p10@wemelug.de> | 2010-07-02 14:48:42 +0200 |
commit | 6129a4583e743961da265e5b5b59e33aa91b44dc (patch) | |
tree | 83febedcf0aaf7af1bb2246495163755b8baa056 | |
parent | faae04e909c1b0358409c0b130ebf4adfa79493f (diff) | |
download | pa-sink-ctl-6129a4583e743961da265e5b5b59e33aa91b44dc.tar.gz pa-sink-ctl-6129a4583e743961da265e5b5b59e33aa91b44dc.tar.bz2 pa-sink-ctl-6129a4583e743961da265e5b5b59e33aa91b44dc.zip |
wip
-rw-r--r-- | pa-sink-ctl.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pa-sink-ctl.c b/pa-sink-ctl.c index ff1679c..8e57441 100644 --- a/pa-sink-ctl.c +++ b/pa-sink-ctl.c @@ -117,15 +117,15 @@ static void get_sink_input_info_callback(pa_context *c, const pa_sink_input_info if (sink_input_counter >= sink_input_max) { sink_input_max*=2; - sink_input_list = (sink_input_info**) realloc(sink_input_list, sizeof(sink_input_info) * sink_input_max); + sink_input_list = (sink_input_info**) realloc(sink_input_list, sizeof(sink_input_info*) * sink_input_max); } - sink_input_list[sink_input_counter] = (sink_input_info*) calloc(1, sizeof(sink_input_info)); - sink_input_list[sink_input_counter]->name = (char*) calloc(strlen(i->name) + 1, sizeof(char)); + sink_input_list[sink_input_counter-1] = (sink_input_info*) calloc(1, sizeof(sink_input_info)); + sink_input_list[sink_input_counter-1]->name = (char*) calloc(strlen(i->name) + 1, sizeof(char)); - sink_input_list[sink_input_counter]->sink = i->sink; - strncpy(sink_input_list[sink_input_counter]->name, i->name, strlen(i->name)); - sink_input_list[sink_input_counter]->vol = pa_cvolume_avg(&i->volume); + sink_input_list[sink_input_counter-1]->sink = i->sink; + strncpy(sink_input_list[sink_input_counter-1]->name, i->name, strlen(i->name)); + sink_input_list[sink_input_counter-1]->vol = pa_cvolume_avg(&i->volume); } void print_sinks(void) |