[vdr] Hard link cutter

Udo Richter udo_richter at gmx.de
Tue Mar 20 21:02:05 CET 2007


Andreas Brachold wrote:
> i like your patch, but its work only on some recordings.
> Its failed with a segmentation fault, on cutting.
> The only differ are unbalanced marks (out missed)

Confirmed, the patch doesn't handle the case that the last mark is a 
cut-in mark, not a cut-out. In that case 'Mark' will be NULL, causing a 
segfault. The attached (untested) patch should do the trick.

Cheers,

Udo

-------------- next part --------------
Index: cutter.c
===================================================================
--- cutter.c	(revision 895)
+++ cutter.c	(working copy)
@@ -167,8 +167,9 @@
                  uchar MarkFileNumber;
                  int MarkFileOffset;
                  // Get file number of next cut mark
-                 if (fromIndex->Get(Mark->position, &MarkFileNumber, &MarkFileOffset)
-                     && (MarkFileNumber != CurrentFileNumber)) {
+                 if (!Mark 
+                     || fromIndex->Get(Mark->position, &MarkFileNumber, &MarkFileOffset)
+                        && (MarkFileNumber != CurrentFileNumber)) {
                     // The current source file will be copied completely.
                     // Start new output file unless we did that already
                     if (FileSize != 0) {


More information about the vdr mailing list