mirror of
https://github.com/smittix/intercept.git
synced 2026-04-25 23:29:59 -07:00
VISDetector._process_window() was calling self.reset() inside the STOP_BIT handler, wiping self._buffer before feed() could advance past the triggering window. All audio samples buffered after the VIS STOP_BIT (the start of the first scan line) were silently discarded, causing the image decoder to begin decoding mid-stream with no alignment reference. The result was every scan line being desynchronised from the first, producing the diagonal stripes and scrambled colours seen in decoded images. Fix: remove the premature reset() from _process_window(). The STOP_BIT handler now sets state=DETECTED and returns the result. A new remaining_buffer property exposes the post-VIS samples. _decode_audio_stream() and decode_file() capture those samples before calling reset(), then immediately feed them into the newly created SSTVImageDecoder so decoding begins from sample 0 of the first sync pulse. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>