author | Jian Xu <jian.xu@amlogic.com> | 2016-05-16 11:05:05 (GMT) |
---|---|---|
committer | Gerrit Code Review <gituser@git.myamlogic.com> | 2016-05-16 11:05:05 (GMT) |
commit | 4ad0ac06e9ea8099e7668beaf13caada035a5457 (patch) | |
tree | 61e5857e6b1d743fce0e3edc2a8a19ca3c20cfe4 | |
parent | d74aeff0d50cfbbbbab86d636b6851a4c088b198 (diff) | |
parent | c6e684ffcfcc2043b3967b3bd5912f51c97898e2 (diff) | |
download | audio-4ad0ac06e9ea8099e7668beaf13caada035a5457.zip audio-4ad0ac06e9ea8099e7668beaf13caada035a5457.tar.gz audio-4ad0ac06e9ea8099e7668beaf13caada035a5457.tar.bz2 |
Merge "PD#125238: audio: set default period size for AF" into m-amlogic
-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; |