]> git.tue.mpg.de Git - paraslash.git/commitdiff
audiod: Simplify parse_receiver_args().
authorAndre Noll <maan@systemlinux.org>
Tue, 19 Apr 2011 19:49:42 +0000 (21:49 +0200)
committerAndre Noll <maan@systemlinux.org>
Fri, 3 Jun 2011 06:39:20 +0000 (08:39 +0200)
Call parse_stream_command() rather than duplicating the logic.

audiod.c

index ff3ba8c218a8748266eddfe2e9c5bf92bcb7c82d..03218e249ec3b69b8863c245628514a5ae32a225 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;