aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Holberton <taylorcholberton@gmail.com>2017-04-13 06:08:33 -0700
committerGitHub <noreply@github.com>2017-04-13 06:08:33 -0700
commit3a4402855c144db0ffe649604e239e0490233e45 (patch)
treea8dba0b35f32f05d0ea7b7d0e216fad68b12424c
parent001b25ef86c1b3843a6c05d41968eb77b2abf905 (diff)
parente125261297a6c33b6f0f441bd446d79dfc7c5f9d (diff)
Merge pull request #96 from subhransu-intel/master
Fix to pass num_frames to pcm_writei
-rw-r--r--utils/tinyplay.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/tinyplay.c b/utils/tinyplay.c
index d0c1e36..ea7e115 100644
--- a/utils/tinyplay.c
+++ b/utils/tinyplay.c
@@ -409,7 +409,8 @@ int play_sample(struct ctx *ctx)
do {
num_read = fread(buffer, 1, size, ctx->file);
if (num_read > 0) {
- if (pcm_writei(ctx->pcm, buffer, num_read) < 0) {
+ if (pcm_writei(ctx->pcm, buffer,
+ pcm_bytes_to_frames(ctx->pcm, num_read)) < 0) {
fprintf(stderr, "error playing sample\n");
break;
}