aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlain Vongsouvanh <alainv@google.com>2018-03-20 00:04:47 +0000
committerandroid-build-merger <android-build-merger@google.com>2018-03-20 00:04:47 +0000
commit2392016e1d74011552da9eb35a22cc4a0959d012 (patch)
tree12b062657b9bff1e8714bf1226ca9819273d55db
parent958c27a33370b5346aa8e63322d391660291ed83 (diff)
parentfefbee682542766a602b9a146934b3db4906622b (diff)
downloadtinyalsa-2392016e1d74011552da9eb35a22cc4a0959d012.tar.gz
Merge "tinycap: Modify capture_sample()for pcm data to frames" am: ce0616534e
am: fefbee6825 Change-Id: I348e1be4885eb6c6c1f7223ba5cc2ed7044bdfdd
-rw-r--r--tinycap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tinycap.c b/tinycap.c
index cea98a1..b0c1908 100644
--- a/tinycap.c
+++ b/tinycap.c
@@ -200,6 +200,7 @@ unsigned int capture_sample(FILE *file, unsigned int card, unsigned int device,
char *buffer;
unsigned int size;
unsigned int bytes_read = 0;
+ unsigned int frames = 0;
struct timespec end;
struct timespec now;
@@ -250,7 +251,8 @@ unsigned int capture_sample(FILE *file, unsigned int card, unsigned int device,
}
}
+ frames = pcm_bytes_to_frames(pcm, bytes_read);
free(buffer);
pcm_close(pcm);
- return pcm_bytes_to_frames(pcm, bytes_read);
+ return frames;
}