summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2017-12-14 14:17:35 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2017-12-14 14:17:35 +0100
commit630cc496ea18d1f4958e650a60af3bcae61cbfb3 (patch)
tree9879f917dfe2506958ff9da522ba662950faaec6
parentc3af5a69da00d5474c0dc480d1b6cfa55fee7b14 (diff)
downloadvdr-630cc496ea18d1f4958e650a60af3bcae61cbfb3.tar.gz
vdr-630cc496ea18d1f4958e650a60af3bcae61cbfb3.tar.bz2
Moved adding the name of the edited recording into the cutting thread, to avoid a problem with locking the Recordings list
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY2
-rw-r--r--cutter.c10
3 files changed, 10 insertions, 3 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 7abbcf63..1c6e0c29 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -3291,6 +3291,7 @@ Matthias Senzel <matthias.senzel@t-online.de>
for implementing the parameter "OSD/Sorting direction for recordings"
for suggesting to stay in the original folder when moving a recording to a different
folder
+ for reporting problem with locking the Recordings list in the cutting process
Marek Nazarko <mnazarko@gmail.com>
for translating OSD texts to the Polish language
diff --git a/HISTORY b/HISTORY
index c3986740..6b5b2d2f 100644
--- a/HISTORY
+++ b/HISTORY
@@ -9234,3 +9234,5 @@ 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).
diff --git a/cutter.c b/cutter.c
index 67dc4ef5..ed924a71 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.3 2017/05/21 09:45:06 kls Exp $
+ * $Id: cutter.c 4.4 2017/12/14 14:09:46 kls Exp $
*/
#include "cutter.h"
@@ -222,6 +222,7 @@ 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;
@@ -286,6 +287,7 @@ 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);
@@ -603,6 +605,10 @@ 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:
@@ -677,8 +683,6 @@ bool cCutter::Start(void)
cRecordingUserCommand::InvokeCommand(RUC_EDITINGRECORDING, editedVersionName, originalVersionName);
if (cVideoDirectory::RemoveVideoFile(editedVersionName) && MakeDirs(editedVersionName, true)) {
Recording.WriteInfo(editedVersionName);
- LOCK_RECORDINGS_WRITE;
- Recordings->AddByName(editedVersionName, false);
cuttingThread = new cCuttingThread(originalVersionName, editedVersionName);
return true;
}