do correct sync extrapolation

This commit is contained in:
Ahmet Inan 2015-01-01 18:57:01 +01:00
parent a69b4089f5
commit 63e949332d

View file

@ -186,6 +186,13 @@ void decode(int samples) {
seperator_counter = 0;
continue;
}
if (hpos >= maximum_length) {
hpos -= scanline_length;
prev_sync_pos = sync_pos;
sync_pos += scanline_length;
} else {
hpos = buffer_pos - sync_pos;
}
switch (current_decoder) {
case decoder_robot36:
robot36_decoder();
@ -202,12 +209,6 @@ void decode(int samples) {
default:
raw_decoder();
}
if (hpos >= maximum_length) {
hpos -= scanline_length;
sync_pos = prev_sync_pos + scanline_length;
} else {
hpos = buffer_pos - sync_pos;
}
++vpos;
if (vpos == bitmap_height)
save_buffer();