audiod: Simplify parse_receiver_args().
[paraslash.git] / audiod.c
index ff3ba8c..03218e2 100644 (file)
--- 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;