author | Shuai Li <shuai.li@amlogic.com> | 2016-05-13 13:17:15 (GMT) |
---|---|---|
committer | Shuai Li <shuai.li@amlogic.com> | 2016-05-13 13:17:15 (GMT) |
commit | c6e684ffcfcc2043b3967b3bd5912f51c97898e2 (patch) | |
tree | 53a3fac89f772a84396b06cbc78b06c61faa8f76 | |
parent | 578ee7432974c11a31292d82b57072570d0e1d12 (diff) | |
download | audio-c6e684ffcfcc2043b3967b3bd5912f51c97898e2.zip audio-c6e684ffcfcc2043b3967b3bd5912f51c97898e2.tar.gz audio-c6e684ffcfcc2043b3967b3bd5912f51c97898e2.tar.bz2 |
PD#125238: audio: set default period size for AF
Change-Id: Id27e5420cc0b33236e0201fc7be4f37b22c0ab28
-rw-r--r-- | audio_hw.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -650,7 +650,6 @@ static int check_input_parameters(uint32_t sample_rate, audio_format_t format, i static size_t get_input_buffer_size(unsigned int period_size,uint32_t sample_rate, audio_format_t format, int channel_count) { size_t size; - size_t device_rate; LOGFUNC("%s(sample_rate=%d, format=%d, channel_count=%d)", __FUNCTION__, sample_rate, format, channel_count); @@ -661,6 +660,10 @@ static size_t get_input_buffer_size(unsigned int period_size,uint32_t sample_rat /* take resampling into account and return the closest majoring multiple of 16 frames, as audioflinger expects audio buffers to be a multiple of 16 frames */ + if (period_size == 0) { + period_size = (pcm_config_in.period_size * sample_rate) / pcm_config_in.rate; + } + size = period_size; size = ((size + 15) / 16) * 16; |