ffplay: use av_clip() instead of nested min & max

Note: {wanted,min,max}_samples are int variables.
This commit is contained in:
Clément Bœsch 2015-06-06 12:50:21 +02:00
parent ade5684cda
commit 0f6118c581
1 changed files with 1 additions and 1 deletions

View File

@ -2412,7 +2412,7 @@ static int synchronize_audio(VideoState *is, int nb_samples)
wanted_nb_samples = nb_samples + (int)(diff * is->audio_src.freq);
min_nb_samples = ((nb_samples * (100 - SAMPLE_CORRECTION_PERCENT_MAX) / 100));
max_nb_samples = ((nb_samples * (100 + SAMPLE_CORRECTION_PERCENT_MAX) / 100));
wanted_nb_samples = FFMIN(FFMAX(wanted_nb_samples, min_nb_samples), max_nb_samples);
wanted_nb_samples = av_clip(wanted_nb_samples, min_nb_samples, max_nb_samples);
}
av_log(NULL, AV_LOG_TRACE, "diff=%f adiff=%f sample_diff=%d apts=%0.3f %f\n",
diff, avg_diff, wanted_nb_samples - nb_samples,