summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pcm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pcm.c b/src/pcm.c
index 548d043..89ce9d0 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -444,7 +444,7 @@ convert(snd_pcm_t *pcm, const size_t frames, const struct io *io, void *arg)
}
}
- return io_bytes;
+ return io_bytes / (params[ei].bps * chans);
}
static size_t
@@ -482,7 +482,7 @@ snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size)
snd_pcm_uframes_t ret;
if (pcm->hw.needs_conversion) {
- ret = snd_pcm_bytes_to_frames(pcm, convert(pcm, size, &io, &state));
+ ret = convert(pcm, size, &io, &state);
} else {
ret = snd_pcm_bytes_to_frames(pcm, io.write(buffer, snd_pcm_frames_to_bytes(pcm, size), &state));
}
@@ -528,7 +528,7 @@ snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size)
snd_pcm_uframes_t ret;
if (pcm->hw.needs_conversion) {
- ret = snd_pcm_bytes_to_frames(pcm, convert(pcm, size, &io, &state));
+ ret = convert(pcm, size, &io, &state);
} else {
ret = snd_pcm_bytes_to_frames(pcm, io.read(buffer, snd_pcm_frames_to_bytes(pcm, size), &state));
}