mirror of
https://github.com/openharmony/third_party_tinyalsa.git
synced 2026-07-19 23:33:30 -04:00
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.
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user