kopia lustrzana https://github.com/xdsopl/robot36
only shift if possible
rodzic
844dc6a0b3
commit
38f0521158
|
@ -145,14 +145,17 @@ public class Decoder {
|
|||
}
|
||||
for (int i = 0; i < lines.length; ++i)
|
||||
copyLines(mode.decodeScanLine(evenBuffer, oddBuffer, scanLineBuffer, pulses[i], lines[i]));
|
||||
int shift = pulses[pulses.length - 1] - (meanSamples * 3) / 4;
|
||||
adjustSyncPulses(last5msSyncPulses, shift);
|
||||
adjustSyncPulses(last9msSyncPulses, shift);
|
||||
adjustSyncPulses(last20msSyncPulses, shift);
|
||||
int endSample = curSample;
|
||||
curSample = 0;
|
||||
for (int i = shift; i < endSample; ++i)
|
||||
scanLineBuffer[curSample++] = scanLineBuffer[i];
|
||||
int reserve = (meanSamples * 3) / 4;
|
||||
int shift = pulses[pulses.length - 1] - reserve;
|
||||
if (shift > reserve) {
|
||||
adjustSyncPulses(last5msSyncPulses, shift);
|
||||
adjustSyncPulses(last9msSyncPulses, shift);
|
||||
adjustSyncPulses(last20msSyncPulses, shift);
|
||||
int endSample = curSample;
|
||||
curSample = 0;
|
||||
for (int i = shift; i < endSample; ++i)
|
||||
scanLineBuffer[curSample++] = scanLineBuffer[i];
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue