core: Rewrite some of the A/V sync related code
Notable functionality changes:
* Timing change between any two frames is now accurately limited to
1/10 of their nominal distance. Previous code did not always use the
correct duration.
* The status line now keeps showing the same A-V sync value from one
video frame change to the next. Previously it kept recalculating
the value using a new audio position but the same video position
when the status line was updated between video frames. This
incorrectly showed the video losing sync with audio.
* The status line now displays actual measured A-V difference in
autosync mode too. The previous code displayed values that
completely ignored real timing in autosync mode, showing 0 A-V
difference even when video was significantly behind audio due to
inadequate decoding speed. The new behavior can make the shown A-V
values appear more unstable if the audio out has unreliable delay
measurements (the most likely reason to use autosync), but this is a
display change rather than a timing quality change.
* Autosync mode now tries to adjust timing by the amount of time
vo_flip() calls take, so the calls start earlier and finish at the
time the frame should be shown. Previously non-autosync mode
adjusted for this but autosync did not.
* The warning about the system being too slow to decode the video in
realtime is now displayed in autosync mode too.