]> cvs.zerfleddert.de Git - record-dvb/commitdiff
defines
authormichael <michael>
Sat, 1 Jul 2006 22:54:16 +0000 (22:54 +0000)
committermichael <michael>
Sat, 1 Jul 2006 22:54:16 +0000 (22:54 +0000)
record-dvb.c

index 38609a4996c27cf7caea23c89a8469e22c57fe00..bb69447e7b72d9a101c244d739046f7f7a9e45db 100644 (file)
@@ -13,8 +13,9 @@
 #include "http.h"
 #include "mcast.h"
 
-#define CHUNKSIZE 3000
-#define GTOD_INTERVAL 100
+#define CHUNKSIZE      3000
+#define GTOD_INTERVAL  100
+#define MAX_ERROR_SLEEP        60
 
 void record(int(*open_fn)(char *), char *url, char *outfile, int duration)
 {
@@ -44,9 +45,12 @@ void record(int(*open_fn)(char *), char *url, char *outfile, int duration)
                        sleep(error_sleep);
                        printf("Reconnecting... ");
                        if ((in = (*open_fn)(url)) < 0) {
-                               if (error_sleep < 60)
+                               if (error_sleep < MAX_ERROR_SLEEP)
                                        error_sleep *= 2;
 
+                               if (error_sleep > MAX_ERROR_SLEEP)
+                                       error_sleep = MAX_ERROR_SLEEP;
+
                                printf("failed\n");
                                continue;
                        } else {
Impressum, Datenschutz