[vlc-commits] audiotrack: use VLC_CLIP

Thomas Guillem git at videolan.org
Tue Mar 10 16:18:39 CET 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar 10 13:59:40 2015 +0000| [b5a3966f6c418b9335c1aacebc926b34b6877ed6] | committer: Jean-Baptiste Kempf

audiotrack: use VLC_CLIP

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b5a3966f6c418b9335c1aacebc926b34b6877ed6
---

 modules/audio_output/audiotrack.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/modules/audio_output/audiotrack.c b/modules/audio_output/audiotrack.c
index 39d116f..b686540 100644
--- a/modules/audio_output/audiotrack.c
+++ b/modules/audio_output/audiotrack.c
@@ -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 )



More information about the vlc-commits mailing list