]> git.sesse.net Git - vlc/commitdiff
audiotrack: use VLC_CLIP
authorThomas Guillem <thomas@gllm.fr>
Tue, 10 Mar 2015 13:59:40 +0000 (13:59 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 10 Mar 2015 15:01:34 +0000 (16:01 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/audio_output/audiotrack.c

index 39d116f8ad8decf1c68f6bd09251a9547bebd4f6..b6865407ba5c94fba01111d2f3ede5b4013504bc 100644 (file)
@@ -643,10 +643,7 @@ JNIThread_Configure( JNIEnv *env, audio_output_t *p_aout )
     audio_sample_format_t fmt = p_sys->fmt;
 
     /* 4000 <= frequency <= 48000 */
-    if( fmt.i_rate < 4000 )
-        fmt.i_rate = 4000;
-    if( fmt.i_rate > 48000 )
-        fmt.i_rate = 48000;
+    fmt.i_rate = VLC_CLIP( fmt.i_rate, 4000, 48000 );
 
     /* We can only accept U8, S16N, FL32 */
     switch( fmt.i_format )