[Android] [PATCH] jni/aout: limit sample rate to 48kHz

Zhang Rui bbcallen at gmail.com
Sat Oct 19 08:53:42 CEST 2013


---
 vlc-android/jni/aout.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/vlc-android/jni/aout.c b/vlc-android/jni/aout.c
index 859509b..a8ae95d 100644
--- a/vlc-android/jni/aout.c
+++ b/vlc-android/jni/aout.c
@@ -79,6 +79,9 @@ int aout_open(void **opaque, char *format, unsigned *rate, unsigned *nb_channels
     LOGV ("Number of channels forced to 2, number of samples to %d", FRAME_SIZE);
     *nb_channels = 2;
 
+    if (*rate > 48000)
+        *rate = 48000;
+
     (*p_env)->CallVoidMethod (p_env, p_sys->j_libVlc, methodIdInitAout,
                               *rate, *nb_channels, FRAME_SIZE);
     if ((*p_env)->ExceptionCheck (p_env))
-- 
1.8.3.4



More information about the Android mailing list