summaryrefslogtreecommitdiff
path: root/aplay/aplay.c
diff options
context:
space:
mode:
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>2022-05-05 13:08:33 +0200
committerJaroslav Kysela <perex@perex.cz>2022-05-31 14:09:29 +0200
commit4b959a447aa1e9ce8d0076fc59fa71ff15f025c3 (patch)
treeb70951ddfd8c134829cbe1c0fa3ef732c2d94b3f /aplay/aplay.c
parentbbc74a61ac7c35e506c3d7f76ecf943cb55736a6 (diff)
downloadalsa-utils-4b959a447aa1e9ce8d0076fc59fa71ff15f025c3.tar.gz
aplay: Fix for arecord recording ghost data
When recording we should only write the amount of data read to output file instead of copying whole buffer. This fixes glitches appearing at the end of recorded file, when stopping recording. Fixes: https://github.com/alsa-project/alsa-utils/pull/150 Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'aplay/aplay.c')
-rw-r--r--aplay/aplay.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/aplay/aplay.c b/aplay/aplay.c
index 86826c0..b3b3635 100644
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -2268,7 +2268,7 @@ static ssize_t pcm_read(u_char *data, size_t rcount)
}
}
abort:
- return rcount;
+ return result;
}
static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)
@@ -3326,7 +3326,7 @@ static void capture(char *orig_name)
}
count -= c;
rest -= c;
- fdcount += c;
+ fdcount += save;
}
/* re-enable SIGUSR1 signal */