diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2018-11-03 17:51:23 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2018-11-03 17:51:23 +0200 |
commit | 60052268e1607035edfe6fc8c2825777ef6a374d (patch) | |
tree | 2762b196c65cda57e7dda3854f1b5df99063caef | |
parent | 02d718389eb3482e573c991b41db9b92cc1c3952 (diff) |
refactor period time setters
-rw-r--r-- | src/pcm.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1090,16 +1090,17 @@ snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir) { - WARNX("%u", val); - params->period_time = val / (uint64_t)1e3; - return 0; + return snd_pcm_hw_params_set_period_time_near(pcm, params, &val, &dir); } int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir) { if (dir) *dir = 0; - if (val) snd_pcm_hw_params_set_period_time(pcm, params, *val, 0); + if (val) { + WARNX("%u", *val); + params->period_time = *val / (uint64_t)1e3; + } return 0; } |