When a duration is specified but the the capture device cannot use the
requested sample rate and an alternative rate is used the duration
sample count must be (re)calculated.
Fixes: https://github.com/alsa-project/alsa-utils/pull/200
Signed-off-by: Tj <hacker@iam.tj>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
off_t count, rest; /* number of bytes to capture */
struct stat statbuf;
+ /* setup sound hardware */
+ set_params();
+
/* get number of bytes to capture */
count = calc_count();
if (count == 0)
/* display verbose output to console */
header(file_type, name);
- /* setup sound hardware */
- set_params();
-
/* write to stdout? */
if (!name || !strcmp(name, "-")) {
fd = fileno(stdout);