Make the password option work on shairplay CLI
authorJuho Vähä-Herttua <juhovh@iki.fi>
Sun, 14 Apr 2013 18:58:26 +0000 (21:58 +0300)
committerJuho Vähä-Herttua <juhovh@iki.fi>
Sun, 14 Apr 2013 18:58:46 +0000 (21:58 +0300)
src/shairplay.c

index 691b24f36f59941117552478dc571c521994970a..bf269efbe76acbf65e421dc9cb4b6e0b350e3a69 100644 (file)
@@ -285,6 +285,7 @@ main(int argc, char *argv[])
        dnssd_t *dnssd;
        raop_t *raop;
        raop_callbacks_t raop_cbs;
+       char *password = NULL;
 
        int error;
 
@@ -322,8 +323,11 @@ main(int argc, char *argv[])
                return -1;
        }
 
+       if (strlen(options.password)) {
+               password = options.password;
+       }
        raop_set_log_level(raop, RAOP_LOG_DEBUG);
-       raop_start(raop, &options.port, hwaddr, sizeof(hwaddr), NULL);
+       raop_start(raop, &options.port, hwaddr, sizeof(hwaddr), password);
 
        error = 0;
        dnssd = dnssd_init(&error);