The best way to minimize it is to minimize the frame rate as close as possible to the screen frequency. There is no vsync in the SDL library if you are not using OpenGL through it, so the only way is to get closer to the frame rate. A hardware dual SDL buffer is not guaranteed, although it is good when it is running. I rarely saw this in action.
In my experience with SDL, you should use OpenGL to completely eliminate the gaps. This is a bit of a correction, but drawing simple 2D textures is not that difficult, and you get a few added bonuses that you can implement, for example, rotation, scaling, blending, etc.
However, if you still want to use software rendering, I would recommend using a dirty rectangle update. It's also a bit hard to get used to, but it saves a ton of processing, which can make it easier to update updates until the whole screen scrolls (unless you scroll the entire playback area or something else). Like the time taken to draw to the buffer, at a minimum, this can cause blitting to occur during screen refresh, which causes a break.
Zoomulator
source share