Audio sync troubles



I've recently bought a DVD-player and have been trying to encode movies to DivX. I'm using SmartRipper for the ripping, DVD2AVI for extracting the AC3-audio and setting up a project which I convert with VFAPI for loading in VirtualDub. I'm using the latest DivX 5.0.1 and my video is of respectable quality. For audio I'm using AZID for converting the AC3 to WAV and then to MP3 via Lame-encoder. Finally I'm using NanDub for merging video and audio.

When I playback the DivX-file and just let it run, there's no problems, everything goes fine, even the audio stays in sync. The trouble begins when I start forwarding and rewinding through the movie, that's when the audio gets out of sync. I've seen DivX-movies, ripped by other people, where the audio always stays in sync, even when forwarding and rewinding through it. Am I doing something wrong? Should I use an other encoder? Please help me...