summaryrefslogtreecommitdiff
path: root/Tools/schnitt/schnitt3.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/schnitt/schnitt3.pl')
-rwxr-xr-xTools/schnitt/schnitt3.pl64
1 files changed, 64 insertions, 0 deletions
diff --git a/Tools/schnitt/schnitt3.pl b/Tools/schnitt/schnitt3.pl
new file mode 100755
index 0000000..7cc0f7f
--- /dev/null
+++ b/Tools/schnitt/schnitt3.pl
@@ -0,0 +1,64 @@
+#!/usr/bin/perl
+
+require "/usr/local/bin/my/schnittcommon.pli";
+
+open (INDEX,"index.vdr");
+$index = $ARGV[0];
+&nextI;
+
+$oldindex = $index;
+$tempindex = $index;
+
+$add = -1;
+
+$fi = sprintf ("%03d.vdr",$file);
+open (FI2,$fi);
+open (FO,">test");
+sysseek (FI2,$offset,0);
+sysread (FI2,$temp,3000000);
+syswrite (FO,$temp,3000000);
+close (FI2);
+close (FO);
+`/usr/local/bin/pvademux.old . test`;
+if ( -s "test.mp2")
+ {
+ `rm test*`;
+ print "$index\n";
+ exit 0;
+ }
+
+while (1)
+ {
+ if ($index == 0)
+ {
+ $add = 1;
+ }
+ if ($add = -1)
+ {
+ $index--;
+ &prevI;
+ }
+ else
+ {
+ nextI;
+ }
+ $fi = sprintf ("%03d.vdr",$file);
+ open (FI2,$fi);
+ open (FO,">test");
+ sysseek (FI2,$offset,0);
+ sysread (FI2,$temp,3000000);
+ syswrite (FO,$temp,3000000);
+ close (FI2);
+ close (FO);
+ `/usr/local/bin/pvademux.old . test`;
+ if ( -s "test.mp2")
+ {
+ `rm test*`;
+ if ($index < 0)
+ {
+ $index *= -1;
+ }
+ print "$index\n";
+ exit 0;
+ }
+ }