Merge pull request #96 from subhransu-intel/master

Fix to pass num_frames to pcm_writei
This commit is contained in:
Taylor Holberton
2017-04-13 06:08:33 -07:00
committed by GitHub
+2 -1
View File
@@ -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;
}