aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Wilson <simonwilson@google.com>2011-08-05 12:00:00 -0700
committerSimon Wilson <simonwilson@google.com>2011-08-05 12:00:03 -0700
commit7de3eaf3508c0c4104da12f5c6caa6147101ac1b (patch)
treee06ab6c8f3eb04ef4592ed5b067f2859e7fc5822
parent3bb114a6459c78ea4e7d2f84568361430f26ff20 (diff)
Ensure threasholds are zeroed before opening pcm
Fixes tinyplay and tinycap after a recent change to allow threasholds to be set in the pcm module.
-rw-r--r--tinycap.c3
-rw-r--r--tinyplay.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/tinycap.c b/tinycap.c
index 2f982d0..3eb5c60 100644
--- a/tinycap.c
+++ b/tinycap.c
@@ -157,6 +157,9 @@ unsigned int capture_sample(FILE *file, unsigned int device,
config.format = PCM_FORMAT_S32_LE;
else if (bits == 16)
config.format = PCM_FORMAT_S16_LE;
+ config.start_threshold = 0;
+ config.stop_threshold = 0;
+ config.silence_threshold = 0;
pcm = pcm_open(0, device, PCM_IN, &config);
if (!pcm || !pcm_is_ready(pcm)) {
diff --git a/tinyplay.c b/tinyplay.c
index 2523e54..3eed64a 100644
--- a/tinyplay.c
+++ b/tinyplay.c
@@ -110,6 +110,9 @@ void play_sample(FILE *file, unsigned int channels, unsigned int rate,
config.format = PCM_FORMAT_S32_LE;
else if (bits == 16)
config.format = PCM_FORMAT_S16_LE;
+ config.start_threshold = 0;
+ config.stop_threshold = 0;
+ config.silence_threshold = 0;
pcm = pcm_open(0, 0, PCM_OUT, &config);
if (!pcm || !pcm_is_ready(pcm)) {