summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Eskola <timo@tolleri.net>2018-09-05 08:49:37 +0300
committerTimo Eskola <timo@tolleri.net>2018-09-05 08:49:37 +0300
commitce02eaf6c6d679458256c21d0efdc514f537d288 (patch)
treef699abab590794bfbecd5a2b6246e536c160b781
parent7a15b576e0c71258506e37e7e522a6763f3529a0 (diff)
parentf0cd07ff71b9c9a48003501d47f1c192224193fa (diff)
downloadvdr-plugin-duplicates-ce02eaf6c6d679458256c21d0efdc514f537d288.tar.gz
vdr-plugin-duplicates-ce02eaf6c6d679458256c21d0efdc514f537d288.tar.bz2
Merge branch 'master' into vdr2.4.0
-rw-r--r--HISTORY3
-rw-r--r--menu.c30
2 files changed, 18 insertions, 15 deletions
diff --git a/HISTORY b/HISTORY
index 8356d79..252ac4d 100644
--- a/HISTORY
+++ b/HISTORY
@@ -5,12 +5,13 @@ VDR Plugin 'duplicates' Revision History
- Dropped support for VDR 2.2.0.
- Added scanner thread for duplicates.
-2018-09-03: Version 0.2.2
+2018-09-05: Version 0.2.2
- Updated kNone handling in main menu.
- Improved duplicate recording copy constructor.
- Added missing recordings lock release.
- Simplified toggle hidden.
+- Fixed recordings locking sequence.
2018-08-30: Version 0.2.1
diff --git a/menu.c b/menu.c
index def6110..87fe450 100644
--- a/menu.c
+++ b/menu.c
@@ -255,18 +255,13 @@ eOSState cMenuDuplicates::Delete(void) {
if (Interface->Confirm(trVDR("Delete recording?"))) {
if (TimerStillRecording(FileName))
return osContinue;
- {
- LOCK_RECORDINGS_READ
- if (const cRecording *Recording = Recordings->GetByName(FileName)) {
- FileName = Recording->FileName();
- if (RecordingsHandler.GetUsage(FileName)) {
- if (!Interface->Confirm(trVDR("Recording is being edited - really delete?")))
- return osContinue;
- }
- }
+ if (RecordingsHandler.GetUsage(FileName)) {
+ if (Interface->Confirm(trVDR("Recording is being edited - really delete?"))) {
+ RecordingsHandler.Del(FileName);
+ } else
+ return osContinue;
}
dsyslog("duplicates: Deleting recording %s.", FileName);
- RecordingsHandler.Del(FileName); // must do this w/o holding a lock, because the cleanup section in cDirCopier::Action() might request one!
if (cReplayControl::NowReplaying() && strcmp(cReplayControl::NowReplaying(), FileName) == 0)
cControl::Shutdown();
cStateKey recordingsStateKey;
@@ -298,14 +293,17 @@ eOSState cMenuDuplicates::Play(void) {
return osContinue;
cMenuDuplicateItem *ri = (cMenuDuplicateItem *)Get(Current());
if (ri) {
- LOCK_RECORDINGS_READ;
+ cStateKey stateKey;
+ const cRecordings *Recordings = cRecordings::GetRecordingsRead(stateKey);
const cRecording *recording = Recordings->GetByName(ri->FileName());
if (recording) {
cDuplicatesReplayControl::SetRecording(recording->FileName());
+ stateKey.Remove();
cControl::Shutdown();
cControl::Launch(new cDuplicatesReplayControl);
return osEnd;
- }
+ } else
+ stateKey.Remove();
}
return osContinue;
}
@@ -323,10 +321,14 @@ eOSState cMenuDuplicates::Info(void) {
return osContinue;
cMenuDuplicateItem *ri = (cMenuDuplicateItem *)Get(Current());
if (ri) {
- LOCK_RECORDINGS_READ;
+ cStateKey stateKey;
+ const cRecordings *Recordings = cRecordings::GetRecordingsRead(stateKey);
const cRecording *recording = Recordings->GetByName(ri->FileName());
- if (recording && recording->Info()->Title())
+ if (recording && recording->Info()->Title()) {
+ stateKey.Remove();
return AddSubMenu(new cMenuDuplicate(recording));
+ } else
+ stateKey.Remove();
}
return osContinue;
}