mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-09-20 01:59:57 +02:00
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>
This commit is contained in:
parent
52f6fb7f33
commit
42bba8ac61
1 changed files with 3 additions and 3 deletions
|
@ -3224,6 +3224,9 @@ static void capture(char *orig_name)
|
||||||
off_t count, rest; /* number of bytes to capture */
|
off_t count, rest; /* number of bytes to capture */
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
|
|
||||||
|
/* setup sound hardware */
|
||||||
|
set_params();
|
||||||
|
|
||||||
/* get number of bytes to capture */
|
/* get number of bytes to capture */
|
||||||
count = calc_count();
|
count = calc_count();
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
|
@ -3242,9 +3245,6 @@ static void capture(char *orig_name)
|
||||||
/* display verbose output to console */
|
/* display verbose output to console */
|
||||||
header(file_type, name);
|
header(file_type, name);
|
||||||
|
|
||||||
/* setup sound hardware */
|
|
||||||
set_params();
|
|
||||||
|
|
||||||
/* write to stdout? */
|
/* write to stdout? */
|
||||||
if (!name || !strcmp(name, "-")) {
|
if (!name || !strcmp(name, "-")) {
|
||||||
fd = fileno(stdout);
|
fd = fileno(stdout);
|
||||||
|
|
Loading…
Reference in a new issue