]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
imagecache: fix re-fetch period mistake.
authorAdam Sutton <dev@adamsutton.me.uk>
Thu, 3 Jan 2013 11:52:36 +0000 (11:52 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Thu, 3 Jan 2013 19:36:24 +0000 (19:36 +0000)
src/imagecache.c

index 224c72cc9be76b9f8b425974cbf2dd82a8e4fd1e..cd2583beed80400f516e9f8a9f2bd41820e3165c 100644 (file)
@@ -366,10 +366,12 @@ static void *_imagecache_thread ( void *p )
       ts.tv_sec += 60;
       err = pthread_cond_timedwait(&_imagecache_cond, &imagecache_mutex, &ts);
       if (err == ETIMEDOUT) {
+        uint32_t period;
         RB_FOREACH(img, &_imagecache_by_url, url_link) {
           if (img->state != IDLE) continue;
-          if ((ts.tv_sec - img->updated) >
-              (img->failed ? imagecache_fail_period : imagecache_ok_period))
+          period = img->failed ? imagecache_fail_period : imagecache_ok_period;
+          period *= 86400;
+          if (period && ((ts.tv_sec - img->updated) > period))
             _imagecache_add(img);
         }
       }