summaryrefslogtreecommitdiff
path: root/dvbapi.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-09-16 09:53:44 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2001-09-16 09:53:44 +0200
commite7ef8190c26e697bd4aae89aee96cf572e48a658 (patch)
tree9b857da6eacaf4e1b0fe9b309133c336bd1cfa76 /dvbapi.c
parent24883d3d230de881aff84cbf52ce8323c2cf353c (diff)
downloadvdr-e7ef8190c26e697bd4aae89aee96cf572e48a658.tar.gz
vdr-e7ef8190c26e697bd4aae89aee96cf572e48a658.tar.bz2
Fixed manipulating an editing mark at the very end of a recording
Diffstat (limited to 'dvbapi.c')
-rw-r--r--dvbapi.c11
1 files changed, 7 insertions, 4 deletions
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 <aschultz@warp10.net>
* based on dvdplayer-0.5 by Matjaz Thaler <matjaz.thaler@guest.arnes.si>
*
- * $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.
}
}
}