From: Jaroslav Kysela Date: Tue, 5 May 2015 17:50:05 +0000 (+0200) Subject: DVR: allow to change stop time and stop_extra when the recording is active X-Git-Tag: v4.1~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22392fa470554a12b6e99e095a1aedb95f2401b6;p=thirdparty%2Ftvheadend.git DVR: allow to change stop time and stop_extra when the recording is active --- diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c index 8f6a4ff91..e095e8dc6 100644 --- a/src/dvr/dvr_db.c +++ b/src/dvr/dvr_db.c @@ -893,8 +893,21 @@ static dvr_entry_t *_dvr_entry_update char buf[40]; int save = 0; - if (!dvr_entry_is_editable(de)) - return de; + if (!dvr_entry_is_editable(de)) { + if (stop < dispatch_clock) + stop = dispatch_clock; + if (stop < de->de_start) + stop = de->de_start; + if (stop != de->de_stop) { + de->de_stop = stop; + save = 1; + } + if (stop_extra && (stop_extra != de->de_stop_extra)) { + de->de_stop_extra = stop_extra; + save = 1; + } + goto dosave; + } /* Start/Stop */ if (e) { @@ -976,6 +989,7 @@ static dvr_entry_t *_dvr_entry_update } /* Save changes */ +dosave: if (save) { idnode_changed(&de->de_id); htsp_dvr_entry_update(de);