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.
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