aboutsummaryrefslogtreecommitdiffstats
path: root/ffplay.c
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2015-06-06 12:50:21 +0200
committerClément Bœsch <u@pkh.me>2015-06-06 13:18:28 +0200
commit0f6118c58169796bdc657794aa88bb72d25b7d98 (patch)
treec4c9d202050b1c1893da1d10fcfbda3dde9f0058 /ffplay.c
parentade5684cda9c08b6a8cdecb5e6b5144d6dac8819 (diff)
downloadffmpeg-0f6118c58169796bdc657794aa88bb72d25b7d98.tar.gz
ffplay: use av_clip() instead of nested min & max
Note: {wanted,min,max}_samples are int variables.
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ffplay.c b/ffplay.c
index 9ce13d71fb..58034c60a9 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -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,