summaryrefslogtreecommitdiff
path: root/recmanager.c
diff options
context:
space:
mode:
authorkamel5 <kamel5 (at) gmx (dot) net>2018-04-01 15:53:09 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-01-27 11:39:34 +0100
commitaa26a69ef800f360d48501596d53fb768ad090f9 (patch)
treeacacc56ec1b29166758ec395be284194dce68640 /recmanager.c
parent91488f0f607391d3735a2a7ae8b138881e5659a2 (diff)
downloadvdr-plugin-tvguide-aa26a69ef800f360d48501596d53fb768ad090f9.tar.gz
vdr-plugin-tvguide-aa26a69ef800f360d48501596d53fb768ad090f9.tar.bz2
Changes in cRecManager::DeleteTimer
Diffstat (limited to 'recmanager.c')
-rw-r--r--recmanager.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/recmanager.c b/recmanager.c
index 8bf94c3..9aff11c 100644
--- a/recmanager.c
+++ b/recmanager.c
@@ -180,9 +180,9 @@ void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string p
void cRecManager::DeleteTimer(int timerID) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
#if VDRVERSNUM >= 20301
- const cTimer *t;
+ cTimer *t;
{
- LOCK_TIMERS_READ;
+ LOCK_TIMERS_WRITE;
t = Timers->Get(timerID);
}
#else
@@ -207,9 +207,9 @@ void cRecManager::DeleteTimer(const cEvent *event) {
void cRecManager::DeleteLocalTimer(const cEvent *event) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
#if VDRVERSNUM >= 20301
- const cTimer *t;
+ cTimer *t;
{
- LOCK_TIMERS_READ;
+ LOCK_TIMERS_WRITE;
t = Timers->GetMatch(event);
}
#else
@@ -220,29 +220,23 @@ void cRecManager::DeleteLocalTimer(const cEvent *event) {
DeleteTimer(t);
}
-
-#if VDRVERSNUM >= 20301
-void cRecManager::DeleteTimer(const cTimer *timer) {
+void cRecManager::DeleteTimer(cTimer *timer) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
+#if VDRVERSNUM >= 20301
LOCK_TIMERS_WRITE;
- cTimers* timers = Timers;
- cTimer* t = timers->GetTimer((cTimer*)timer); // #TODO dirty cast
-
- if (t->Recording()) {
- t->Skip();
- cRecordControls::Process(timers, time(NULL));
- }
-#else
-void cRecManager::DeleteTimer(cTimer *timer) {
+#endif
if (timer->Recording()) {
timer->Skip();
+#if VDRVERSNUM >= 20301
+ cRecordControls::Process(Timers, time(NULL));
+#else
cRecordControls::Process(time(NULL));
- }
#endif
+ }
isyslog("timer %s deleted", *timer->ToDescr());
#if VDRVERSNUM >= 20301
- timers->Del(t, true);
- timers->SetModified();
+ Timers->Del(timer, true);
+ Timers->SetModified();
#else
Timers.Del(timer, true);
Timers.SetModified();