diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2008-12-20 16:15:39 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2008-12-20 22:08:19 (GMT) |
commit | 5978d17f89f587e47873bbd305854f972f6a944d (patch) | |
tree | 0f8c45696b5d653abff263acf34a2a68a3e23a37 | |
parent | 2703e7ef75c0efb0e9cfe41b293820ae57a7ee45 (diff) |
use snd_pcm_hw_params_set_rate_near to set alsa rate
-rw-r--r-- | common/Util/Clooper/audio.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/common/Util/Clooper/audio.cpp b/common/Util/Clooper/audio.cpp index 9fdbbce..9a030c0 100644 --- a/common/Util/Clooper/audio.cpp +++ b/common/Util/Clooper/audio.cpp @@ -103,7 +103,7 @@ struct SystemStuff if ( 0 > snd_pcm_hw_params_set_format(phandle, hw, sample_format)) { ERROR_HERE; goto open_error;} if ( 0 > snd_pcm_hw_params_set_channels(phandle, hw, 2)) { ERROR_HERE; goto open_error;} - if ( snd_pcm_hw_params_test_rate(phandle, hw, rate, 0)) + if ( snd_pcm_hw_params_set_rate_near(phandle, hw, &rate, 0)) { ll->printf("test_rate failed( %i\n", rate); continue; @@ -111,7 +111,6 @@ struct SystemStuff else { ll->printf(1, "success! setting rate : %i\n", rate); - if (0 > snd_pcm_hw_params_set_rate(phandle, hw, rate, 0)) { ERROR_HERE; goto open_error;} snd_pcm_uframes_t minb=0, maxb= 0; int mind=0, maxd=0; |