]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvr: Change time(NULL) to gclk for consistency.
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Fri, 21 Sep 2018 23:29:05 +0000 (00:29 +0100)
committerperexg <perex@perex.cz>
Wed, 26 Sep 2018 15:30:47 +0000 (17:30 +0200)
src/dvr/dvr_db.c

index 4fb3d6b930b6f5097e0310316d0dd63e79c2d8ed..5c8671b8fa4d8b652e0a79d667bdc4dff713d646 100644 (file)
@@ -990,7 +990,7 @@ dvr_entry_create(const char *uuid, htsmsg_t *conf, int clone)
        * and get something reasonable. For all new records however, we
        * use now since they will be written to disk.
        */
-      now = time(NULL);
+      now = gclk();
       if (now > start && start < now - 86400)
           create = start;
       else
@@ -1803,9 +1803,9 @@ dvr_is_better_recording_timeslot(const epg_broadcast_t *new_bcast, const dvr_ent
    * get 50 minutes.
    */
   if (new_bcast->start != old_bcast->start) {
-    if (new_bcast->start > old_bcast->start && time(NULL) >  old_bcast->start) {
+    if (new_bcast->start > old_bcast->start && gclk() >  old_bcast->start) {
       return 1;
-    } else if (new_bcast->start < old_bcast->start && time(NULL) > new_bcast->start) {
+    } else if (new_bcast->start < old_bcast->start && gclk() > new_bcast->start) {
       return 0;
     }
 
@@ -2055,7 +2055,7 @@ dvr_entry_destroy(dvr_entry_t *de, int delconf)
    * created and then immediately destroyed, giving a few seconds
    * lee-way in case of slow hardware.
    */
-  if (!de->de_create || time(NULL) - de->de_create > 10)
+  if (!de->de_create || gclk() - de->de_create > 10)
       dvr_autorec_async_reschedule();
   dvr_entry_dec_ref(de);
 }