X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=audiod.c;h=8dd69c60910a725999b193c3e254df9f9c69c2a3;hp=64ea8a51efeeb13cb65f86d1ea417120679ff2f4;hb=be9f7c9b442f7b723427a79f85774d5fa7718425;hpb=d5738d17b54186db8c9c7f119a03b58382ae9be4 diff --git a/audiod.c b/audiod.c index 64ea8a51..8dd69c60 100644 --- a/audiod.c +++ b/audiod.c @@ -33,6 +33,7 @@ #include "write.h" #include "write_common.h" #include "signal.h" +#include "version.h" /** define the array of error lists needed by para_audiod */ INIT_AUDIOD_ERRLISTS; @@ -823,6 +824,14 @@ static int parse_receiver_args(void) ret = get_audio_format_num(arg); if (ret < 0) goto out; + /* + * If multiple receivers are given for this audio format, the + * last one wins and we have to free the previous receiver + * config here. Since we are iterating backwards, the winning + * receiver arg is in fact the first one given. + */ + if (afi[ret].receiver_conf) + afi[ret].receiver->free_config(afi[ret].receiver_conf); afi[ret].receiver_conf = check_receiver_arg(recv_arg, &receiver_num); if (!afi[ret].receiver_conf) { ret = -E_RECV_SYNTAX; @@ -830,9 +839,9 @@ static int parse_receiver_args(void) } afi[ret].receiver = &receivers[receiver_num]; } - /* use the first available receiver with no arguments - * for those audio formats for which no receiver - * was specified + /* + * Use the first available receiver with no arguments for those audio + * formats for which no receiver was specified. */ cmd = para_strdup(receivers[0].name); FOR_EACH_AUDIO_FORMAT(i) {