tinycap: Modify capture_sample()for pcm data to frames
Test: Without "Captured 0 frames" when generate wav file.
Change-Id: I4d1e08a7ae7d5e43a5415d812506dd1a783ac4cf
diff --git a/tinycap.c b/tinycap.c
index cea98a1..b0c1908 100644
--- a/tinycap.c
+++ b/tinycap.c
@@ -200,6 +200,7 @@
char *buffer;
unsigned int size;
unsigned int bytes_read = 0;
+ unsigned int frames = 0;
struct timespec end;
struct timespec now;
@@ -250,7 +251,8 @@
}
}
+ frames = pcm_bytes_to_frames(pcm, bytes_read);
free(buffer);
pcm_close(pcm);
- return pcm_bytes_to_frames(pcm, bytes_read);
+ return frames;
}