summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2018-01-16 14:11:40 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2018-01-16 14:11:40 +0100
commitae41be85c812de20bc38f4b99030cdf277ddeec6 (patch)
tree5f509af78eb8fd3a7e24d9328800a7a57651f894
parente7936c8595f183cc0a916a27ff1ac613419a6b92 (diff)
downloadvdr-ae41be85c812de20bc38f4b99030cdf277ddeec6.tar.gz
vdr-ae41be85c812de20bc38f4b99030cdf277ddeec6.tar.bz2
Moved any locking from cutter.c into recording.c
-rw-r--r--HISTORY6
-rw-r--r--cutter.c10
-rw-r--r--recording.c11
3 files changed, 14 insertions, 13 deletions
diff --git a/HISTORY b/HISTORY
index f8fa5fff..36464ade 100644
--- a/HISTORY
+++ b/HISTORY
@@ -9162,7 +9162,7 @@ Video Disk Recorder Revision History
a subdirectory.
- SVDRP peering can now be limited to the default SVDRP host (see MANUAL for details).
-2017-12-15: Version 2.3.9
+2018-01-16: Version 2.3.9
- Updated the Italian OSD texts (thanks to Diego Pierotto).
- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
@@ -9234,11 +9234,11 @@ Video Disk Recorder Revision History
new location of the recording, but rather stays in the original folder (suggested by
Matthias Senzel). If the original folder got empty by moving away the last recording
it contained, the cursor is moved up until a non empty folder is found.
-- Moved adding the name of the edited recording into the cutting thread, to avoid a
- problem with locking the Recordings list (reported by Matthias Senzel).
- Changed the log message ""ERROR: copying directory '%s' to '%s' ended prematurely" from
"error" to "info", because any actual error would have already been reported before this
(suggested by Matthias Senzel).
- When selecting a folder for a recording or timer, it is now possible to open a folder
even if it doesn't contain any subfolders (suggested by Matthias Senzel).
- Fixed a possible deadlock when detaching a receiver from a device.
+- Moved any locking from cutter.c into recording.c, to avoid a problem with locking
+ the Recordings list (reported by Matthias Senzel).
diff --git a/cutter.c b/cutter.c
index ed924a71..525214c9 100644
--- a/cutter.c
+++ b/cutter.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: cutter.c 4.4 2017/12/14 14:09:46 kls Exp $
+ * $Id: cutter.c 4.5 2018/01/16 14:09:14 kls Exp $
*/
#include "cutter.h"
@@ -222,7 +222,6 @@ void cMpeg2Fixer::AdjTref(int TrefOffset)
class cCuttingThread : public cThread {
private:
- cString editedVersionName; // we add the edited version's name to Recordings only after the cutting process has successfully started, so we need to store that name here
const char *error;
bool isPesRecording;
double framesPerSecond;
@@ -287,7 +286,6 @@ cCuttingThread::cCuttingThread(const char *FromFileName, const char *ToFileName)
if (fromMarks.Load(FromFileName, framesPerSecond, isPesRecording) && fromMarks.Count()) {
numSequences = fromMarks.GetNumSequences();
if (numSequences > 0) {
- editedVersionName = ToFileName;
fromFileName = new cFileName(FromFileName, false, true, isPesRecording);
toFileName = new cFileName(ToFileName, true, true, isPesRecording);
fromIndex = new cIndexFile(FromFileName, false, isPesRecording);
@@ -605,10 +603,6 @@ void cCuttingThread::Action(void)
toFile = toFileName->Open();
if (!fromFile || !toFile)
return;
- {
- LOCK_RECORDINGS_WRITE;
- Recordings->AddByName(editedVersionName, false);
- }
int LastEndIndex = -1;
while (BeginMark && Running()) {
// Suspend cutting if we have severe throughput problems:
@@ -707,8 +701,6 @@ void cCutter::Stop(void)
if (cReplayControl::NowReplaying() && strcmp(cReplayControl::NowReplaying(), editedVersionName) == 0)
cControl::Shutdown();
cVideoDirectory::RemoveVideoFile(editedVersionName);
- LOCK_RECORDINGS_WRITE;
- Recordings->DelByName(editedVersionName);
}
}
diff --git a/recording.c b/recording.c
index 0dd4da5f..bb99d219 100644
--- a/recording.c
+++ b/recording.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: recording.c 4.16 2018/01/16 11:09:26 kls Exp $
+ * $Id: recording.c 4.17 2018/01/16 14:07:04 kls Exp $
*/
#include "recording.h"
@@ -1908,6 +1908,7 @@ bool cRecordingsHandlerEntry::Active(cRecordings *Recordings)
// Now check if there is something to start:
if ((Usage() & ruPending) != 0) {
if ((Usage() & ruCut) != 0) {
+ Recordings->AddByName(FileNameDst(), false);
cutter = new cCutter(FileNameSrc());
cutter->Start();
}
@@ -1932,6 +1933,14 @@ bool cRecordingsHandlerEntry::Active(cRecordings *Recordings)
void cRecordingsHandlerEntry::Cleanup(cRecordings *Recordings)
{
+ if ((usage & ruCut)) { // this was a cut operation...
+ if (cutter) { // ...which had not yet ended
+ delete cutter;
+ cutter = NULL;
+ }
+ cVideoDirectory::RemoveVideoFile(fileNameDst);
+ Recordings->DelByName(fileNameDst);
+ }
if ((usage & (ruMove | ruCopy)) // this was a move/copy operation...
&& ((usage & ruPending) // ...which had not yet started...
|| copier // ...or not yet finished...