Following some real pain playing video files on an Android Set-top box, the only way to get decent sync between video and audio was to convert all files to .mkv format.
So here is a reminder, quick way to convert files to mkv format(on linux )
a)install mkvmerge
b)mkvmerge -o output.mkv input.avi (or mp4 or whatever)