implement (probably working) multicast
[record-dvb] / record-dvb.c
index d32eba1fe0576d63a75f9c5328d6c85d7b01703b..b27ce74908192e938cf574bd2bce0c8d6cc211ec 100644 (file)
@@ -40,7 +40,8 @@ void record(int(*open_fn)(char *), char *url, char *outfile, int duration)
        do {
                if ((bytes = recv(in, buffer, CHUNKSIZE, 0)) < 1) {
                        /* TODO: Insert better connection-loss recovery here */
        do {
                if ((bytes = recv(in, buffer, CHUNKSIZE, 0)) < 1) {
                        /* TODO: Insert better connection-loss recovery here */
-                       in = (*open_fn)(url);
+                       if ((in = (*open_fn)(url)) < 0)
+                               sleep(1);
                }
                written = 0;
                do {
                }
                written = 0;
                do {
Impressum, Datenschutz