1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +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;