1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 12:53:51 +00:00

Fix audio sync correction sizes

This commit is contained in:
Chris Robinson 2012-12-13 18:05:27 -08:00
parent e291d0943d
commit 6cedd64509

View file

@ -197,8 +197,8 @@ class MovieAudioDecoder : public MWSound::Sound_Decoder
if(fabs(avg_diff) >= is->audio_diff_threshold)
{
wanted_size = samples_size + ((int)(diff * is->audio_st->codec->sample_rate) * n);
min_size = samples_size * ((100 - SAMPLE_CORRECTION_PERCENT_MAX) / 100);
max_size = samples_size * ((100 + SAMPLE_CORRECTION_PERCENT_MAX) / 100);
min_size = samples_size/n * (100-SAMPLE_CORRECTION_PERCENT_MAX) / 100 * n;
max_size = samples_size/n * (100+SAMPLE_CORRECTION_PERCENT_MAX) / 100 * n;
if(wanted_size < min_size)
wanted_size = min_size;