From: Andre Noll Date: Tue, 19 Apr 2011 19:49:42 +0000 (+0200) Subject: audiod: Simplify parse_receiver_args(). X-Git-Tag: v0.4.8~32^2~1 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=3d32ae4802777abf524da9314a9c0bf9259d815e;p=paraslash.git audiod: Simplify parse_receiver_args(). Call parse_stream_command() rather than duplicating the logic. --- diff --git a/audiod.c b/audiod.c index ff3ba8c2..03218e24 100644 --- a/audiod.c +++ b/audiod.c @@ -812,16 +812,10 @@ static int parse_receiver_args(void) struct audio_format_info *a; for (i = conf.receiver_given - 1; i >= 0; i--) { - char *arg = conf.receiver_arg[i]; - char *recv_arg = strchr(arg, ':'); - int af_mask, j; + char *arg; + int j, af_mask; - ret = -E_MISSING_COLON; - if (!recv_arg) - goto out; - *recv_arg = '\0'; - recv_arg++; - ret = get_matching_audio_format_nums(arg); + ret = parse_stream_command(conf.receiver_arg[i], &arg); if (ret < 0) goto out; af_mask = ret; @@ -837,7 +831,7 @@ static int parse_receiver_args(void) */ if (a->receiver_conf) a->receiver->free_config(a->receiver_conf); - a->receiver_conf = check_receiver_arg(recv_arg, &receiver_num); + a->receiver_conf = check_receiver_arg(arg, &receiver_num); ret = -E_RECV_SYNTAX; if (!a->receiver_conf) goto out;