Skip to content

Instantly share code, notes, and snippets.

@Themaister
Created June 20, 2011 00:39
Show Gist options
  • Save Themaister/1034956 to your computer and use it in GitHub Desktop.
Save Themaister/1034956 to your computer and use it in GitHub Desktop.
if (autosync) {
/*
* Adjust this raw delay value by calculating the expected
* delay for this frame and generating a new value which is
* weighted between the two. The higher autosync is, the
* closer to the delay value gets to that which "-nosound"
* would have used, and the longer it will take for A/V
* sync to settle at the right value (but it eventually will.)
* This settling time is very short for values below 100.
*/
float predicted = mpctx->delay / playback_speed + *time_frame;
float difference = delay - predicted;
delay = predicted + difference / (float)autosync;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment