From e57c1da3760c33db53901f24b137d193fce309d1 Mon Sep 17 00:00:00 2001 From: "E.Smith" <31170571+azlm8t@users.noreply.github.com> Date: Mon, 17 Sep 2018 20:41:52 +0100 Subject: [PATCH] dvr: Only do time slot scheduling in the scheduled state. 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c index 8b05e5fc1..cc705e3b6 100644 --- a/src/dvr/dvr_db.c +++ b/src/dvr/dvr_db.c @@ -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 -- 2.47.3