mirror of
https://github.com/openharmony/third_party_tinyalsa.git
synced 2026-07-19 15:24:22 -04:00
Merge pull request #96 from subhransu-intel/master
Fix to pass num_frames to pcm_writei
This commit is contained in:
+2
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user