]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvr: Only do time slot scheduling in the scheduled state.
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Mon, 17 Sep 2018 19:41:52 +0000 (20:41 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 20 Sep 2018 12:28:36 +0000 (14:28 +0200)
We do not want a currently recording programme to be cancelled
due to a better channel being found. For example recording a SD
channel and then the OTA updates and finds an HD version of the
show at the same time and so tries to schedule that HD version
instead.

src/dvr/dvr_db.c

index 8b05e5fc10e2ad88b057eb95be57b0facc5fff11..cc705e3b6da4ce4c7e064848a4d57e9eef655808 100644 (file)
@@ -1715,6 +1715,12 @@ dvr_is_better_recording_timeslot(const epg_broadcast_t *new_bcast, const dvr_ent
   if (!new_channel) return 0;
   if (!old_channel) return 1;
 
+  /* If programme is recording then it is the "best", even if a better
+   * schedule is found after recording starts.
+   */
+  if (old_de->de_sched_state != DVR_SCHEDULED)
+    return 0;
+
   /* Always prefer a recording that has the correct service profile
    * (UHD, HD, SD).  Someone mentioned (#1846) that some channels can
    * show a recording earlier in the week in SD then later in the week