mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Moved adding the name of the edited recording into the cutting thread, to avoid a problem with locking the Recordings list
This commit is contained in:
parent
c3af5a69da
commit
630cc496ea
@ -3291,6 +3291,7 @@ Matthias Senzel <matthias.senzel@t-online.de>
|
|||||||
for implementing the parameter "OSD/Sorting direction for recordings"
|
for implementing the parameter "OSD/Sorting direction for recordings"
|
||||||
for suggesting to stay in the original folder when moving a recording to a different
|
for suggesting to stay in the original folder when moving a recording to a different
|
||||||
folder
|
folder
|
||||||
|
for reporting problem with locking the Recordings list in the cutting process
|
||||||
|
|
||||||
Marek Nazarko <mnazarko@gmail.com>
|
Marek Nazarko <mnazarko@gmail.com>
|
||||||
for translating OSD texts to the Polish language
|
for translating OSD texts to the Polish language
|
||||||
|
2
HISTORY
2
HISTORY
@ -9234,3 +9234,5 @@ Video Disk Recorder Revision History
|
|||||||
new location of the recording, but rather stays in the original folder (suggested by
|
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
|
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.
|
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).
|
||||||
|
10
cutter.c
10
cutter.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* 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"
|
#include "cutter.h"
|
||||||
@ -222,6 +222,7 @@ void cMpeg2Fixer::AdjTref(int TrefOffset)
|
|||||||
|
|
||||||
class cCuttingThread : public cThread {
|
class cCuttingThread : public cThread {
|
||||||
private:
|
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;
|
const char *error;
|
||||||
bool isPesRecording;
|
bool isPesRecording;
|
||||||
double framesPerSecond;
|
double framesPerSecond;
|
||||||
@ -286,6 +287,7 @@ cCuttingThread::cCuttingThread(const char *FromFileName, const char *ToFileName)
|
|||||||
if (fromMarks.Load(FromFileName, framesPerSecond, isPesRecording) && fromMarks.Count()) {
|
if (fromMarks.Load(FromFileName, framesPerSecond, isPesRecording) && fromMarks.Count()) {
|
||||||
numSequences = fromMarks.GetNumSequences();
|
numSequences = fromMarks.GetNumSequences();
|
||||||
if (numSequences > 0) {
|
if (numSequences > 0) {
|
||||||
|
editedVersionName = ToFileName;
|
||||||
fromFileName = new cFileName(FromFileName, false, true, isPesRecording);
|
fromFileName = new cFileName(FromFileName, false, true, isPesRecording);
|
||||||
toFileName = new cFileName(ToFileName, true, true, isPesRecording);
|
toFileName = new cFileName(ToFileName, true, true, isPesRecording);
|
||||||
fromIndex = new cIndexFile(FromFileName, false, isPesRecording);
|
fromIndex = new cIndexFile(FromFileName, false, isPesRecording);
|
||||||
@ -603,6 +605,10 @@ void cCuttingThread::Action(void)
|
|||||||
toFile = toFileName->Open();
|
toFile = toFileName->Open();
|
||||||
if (!fromFile || !toFile)
|
if (!fromFile || !toFile)
|
||||||
return;
|
return;
|
||||||
|
{
|
||||||
|
LOCK_RECORDINGS_WRITE;
|
||||||
|
Recordings->AddByName(editedVersionName, false);
|
||||||
|
}
|
||||||
int LastEndIndex = -1;
|
int LastEndIndex = -1;
|
||||||
while (BeginMark && Running()) {
|
while (BeginMark && Running()) {
|
||||||
// Suspend cutting if we have severe throughput problems:
|
// Suspend cutting if we have severe throughput problems:
|
||||||
@ -677,8 +683,6 @@ bool cCutter::Start(void)
|
|||||||
cRecordingUserCommand::InvokeCommand(RUC_EDITINGRECORDING, editedVersionName, originalVersionName);
|
cRecordingUserCommand::InvokeCommand(RUC_EDITINGRECORDING, editedVersionName, originalVersionName);
|
||||||
if (cVideoDirectory::RemoveVideoFile(editedVersionName) && MakeDirs(editedVersionName, true)) {
|
if (cVideoDirectory::RemoveVideoFile(editedVersionName) && MakeDirs(editedVersionName, true)) {
|
||||||
Recording.WriteInfo(editedVersionName);
|
Recording.WriteInfo(editedVersionName);
|
||||||
LOCK_RECORDINGS_WRITE;
|
|
||||||
Recordings->AddByName(editedVersionName, false);
|
|
||||||
cuttingThread = new cCuttingThread(originalVersionName, editedVersionName);
|
cuttingThread = new cCuttingThread(originalVersionName, editedVersionName);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user