Make shairplay not exit after 100 seconds
authorJuho Vähä-Herttua <juhovh@iki.fi>
Tue, 9 Apr 2013 09:29:19 +0000 (12:29 +0300)
committerJuho Vähä-Herttua <juhovh@iki.fi>
Tue, 9 Apr 2013 09:29:19 +0000 (12:29 +0300)
src/shairplay.c

index 6ee23bad4b4ca81096d61219fab081d9edc01393..9cccf030d0945d09143e9395e4c6aa2f34c66a1d 100644 (file)
@@ -37,6 +37,9 @@ typedef struct {
 } shairplay_session_t;
 
 
+static int running;
+
+
 static ao_device *
 audio_open_device(shairplay_options_t *opt, int bits, int channels, int samplerate)
 {
@@ -283,11 +286,14 @@ main(int argc, char *argv[])
        dnssd_register_raop(dnssd, options.apname, options.port, hwaddr, sizeof(hwaddr), 0);
        dnssd_register_airplay(dnssd, options.apname, 1234, hwaddr, sizeof(hwaddr));
 
+       running = 1;
+       while (running) {
 #ifndef WIN32
-       sleep(100);
+               sleep(1);
 #else
-       Sleep(100*1000);
+               Sleep(1000);
 #endif
+       }
 
        dnssd_unregister_raop(dnssd);
        dnssd_destroy(dnssd);