From e7ef8190c26e697bd4aae89aee96cf572e48a658 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 16 Sep 2001 09:53:44 +0200 Subject: [PATCH] Fixed manipulating an editing mark at the very end of a recording --- HISTORY | 1 + dvbapi.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/HISTORY b/HISTORY index 319e35af..e7b24cfc 100644 --- a/HISTORY +++ b/HISTORY @@ -752,3 +752,4 @@ Video Disk Recorder Revision History - New version of the "Master-Timer" tool (thanks to Matthias Schniedermeyer). - Better error handling when writing configuration files. - Fixed putting the final editing mark into the edited version's marks file. +- Fixed manipulating an editing mark at the very end of a recording. diff --git a/dvbapi.c b/dvbapi.c index 4a019cca..65e4aeb2 100644 --- a/dvbapi.c +++ b/dvbapi.c @@ -7,7 +7,7 @@ * DVD support initially written by Andreas Schultz * based on dvdplayer-0.5 by Matjaz Thaler * - * $Id: dvbapi.c 1.122 2001/09/16 09:35:51 kls Exp $ + * $Id: dvbapi.c 1.123 2001/09/16 09:52:57 kls Exp $ */ //#define DVDDEBUG 1 @@ -284,7 +284,7 @@ int cIndexFile::GetNextIFrame(int Index, bool Forward, uchar *FileNumber, int *F int d = Forward ? 1 : -1; for (;;) { Index += d; - if (Index >= 0 && Index <= last - 100) { // '- 100': need to stay off the end! + if (Index >= 0 && Index <= last) { if (index[Index].type == I_FRAME) { if (FileNumber) *FileNumber = index[Index].number; @@ -2364,6 +2364,8 @@ void cCuttingBuffer::Action(void) // Write one frame: if (PictureType == I_FRAME) { // every file shall start with an I_FRAME + if (!Mark) // edited version shall end before next I-frame + break; if (FileSize > MEGABYTE(Setup.MaxVideoFileSize)) { toFile = toFileName->NextFile(); if (toFile < 0) @@ -2391,8 +2393,9 @@ void cCuttingBuffer::Action(void) Mark = fromMarks.Next(Mark); CurrentFileNumber = 0; // triggers SetOffset before reading next frame } - else - break; // final end mark reached + // the 'else' case (i.e. 'final end mark reached') is handled above + // in 'Write one frame', so that the edited version will end right + // before the next I-frame. } } }