Fixed a bug in the editing process

This commit is contained in:
Klaus Schmidinger 2002-04-06 15:28:08 +02:00
parent 367b3f8c7d
commit 3581c20976
3 changed files with 21 additions and 1 deletions

View File

@ -271,3 +271,8 @@ Michael Moster <dvb@juelich-gmbh.de>
Tobias Kerner <tobschle@gmx.de>
for helping to debug a problem with wrong EPG data in the Schedules menu
Dirk Wiebel <dirk@wiebel.de>
for reporting a bug in the editing process in case a previously edited file
with the same name was manually deleted on a system with more than one video
directory

View File

@ -1186,3 +1186,6 @@ Video Disk Recorder Revision History
to an other DVB card (suggested by Sergei Haller).
- Fixed a possible hangup when reading a broken epg.data file (thanks to Henning
Holtschneider for pointing this one out).
- Fixed a bug in the editing process in case a previously edited file with the
same name was manually deleted on a system with more than one video directory
(thanks to Dirk Wiebel for reporting this one).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbapi.c 1.168 2002/04/06 13:14:40 kls Exp $
* $Id: dvbapi.c 1.169 2002/04/06 15:21:29 kls Exp $
*/
#include "dvbapi.h"
@ -1613,6 +1613,18 @@ bool cVideoCutter::Start(const char *FileName)
cRecording Recording(FileName);
const char *evn = Recording.PrefixFileName('%');
if (evn && RemoveVideoFile(evn) && MakeDirs(evn, true)) {
// XXX this can be removed once RenameVideoFile() follows symlinks (see videodir.c)
// remove a possible deleted recording with the same name to avoid symlink mixups:
char *s = strdup(evn);
char *e = strrchr(s, '.');
if (e) {
if (strcmp(e, ".rec") == 0) {
strcpy(e, ".del");
RemoveVideoFile(s);
}
}
delete s;
// XXX
editedVersionName = strdup(evn);
Recording.WriteSummary();
cuttingBuffer = new cCuttingBuffer(FileName, editedVersionName);