diff options
author | Tj <hacker@iam.tj> | 2023-04-15 10:25:16 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2023-05-03 16:26:22 +0200 |
commit | 42bba8ac6113710317cf19bafd5da246f72056bf (patch) | |
tree | 9fa7cec830fb831c2e6dd907c5d31afc39d33ce7 | |
parent | 52f6fb7f3386d4ecc1481d88bd0bd2b7e47c1332 (diff) | |
download | alsa-utils-42bba8ac6113710317cf19bafd5da246f72056bf.tar.gz |
arecord: use correct duration
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>
-rw-r--r-- | aplay/aplay.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/aplay/aplay.c b/aplay/aplay.c index d6b2e80..ae87743 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -3224,6 +3224,9 @@ static void capture(char *orig_name) 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) @@ -3242,9 +3245,6 @@ static void capture(char *orig_name) /* display verbose output to console */ header(file_type, name); - /* setup sound hardware */ - set_params(); - /* write to stdout? */ if (!name || !strcmp(name, "-")) { fd = fileno(stdout); |