diff options
author | waker <wakeroid@gmail.com> | 2010-12-30 23:16:58 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2010-12-30 23:16:58 +0100 |
commit | 183012b22e1b5d9db42c8da0fe9e964c3ad3dcf4 (patch) | |
tree | ce435f6c95a21937d879d660b31be89cbb41b00f | |
parent | 5d8256e110c909ec8ff4d977ae57f1c7e83ac0a9 (diff) |
limit samplerate to [8000..192000] range in SRC plugin
-rw-r--r-- | plugins/dsp_libsrc/src.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/dsp_libsrc/src.c b/plugins/dsp_libsrc/src.c index 1909fa6e..5fe0a7ac 100644 --- a/plugins/dsp_libsrc/src.c +++ b/plugins/dsp_libsrc/src.c @@ -202,6 +202,12 @@ ddb_src_set_param (ddb_dsp_context_t *ctx, int p, const char *val) { switch (p) { case SRC_PARAM_SAMPLERATE: ((ddb_src_libsamplerate_t*)ctx)->samplerate = atof (val); + if (((ddb_src_libsamplerate_t*)ctx)->samplerate < 8000) { + ((ddb_src_libsamplerate_t*)ctx)->samplerate = 8000; + } + if (((ddb_src_libsamplerate_t*)ctx)->samplerate > 192000) { + ((ddb_src_libsamplerate_t*)ctx)->samplerate = 192000; + } break; case SRC_PARAM_QUALITY: ((ddb_src_libsamplerate_t*)ctx)->quality = atoi (val); |