mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
pcm: another fix for the snd_pcm_area_silence() fast path
The 64-bit fast path can be used only in limited conditions: - destination must be aligned to 64-bit (CPU aligned access) - step must be equal to width - physical with must be different than 24 (cannot be multiplied to 64) Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
36decd209f
commit
af531606b7
1 changed files with 3 additions and 1 deletions
|
|
@ -2951,7 +2951,9 @@ int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_area, snd_pcm_uframes
|
||||||
* Iterate copying silent sample for sample data aligned to 64 bit.
|
* Iterate copying silent sample for sample data aligned to 64 bit.
|
||||||
* This is a fast path.
|
* This is a fast path.
|
||||||
*/
|
*/
|
||||||
if (dst_area->step == (unsigned int) width && (64 % width) == 0) {
|
if (dst_area->step == (unsigned int) width &&
|
||||||
|
width != 24 &&
|
||||||
|
((intptr_t)dst & 7) == 0) {
|
||||||
unsigned int dwords = samples * width / 64;
|
unsigned int dwords = samples * width / 64;
|
||||||
uint64_t *dstp = (uint64_t *)dst;
|
uint64_t *dstp = (uint64_t *)dst;
|
||||||
samples -= dwords * 64 / width;
|
samples -= dwords * 64 / width;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue