mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
spa: small performance fixes
This commit is contained in:
parent
387dee3237
commit
d8cac792f4
2 changed files with 22 additions and 6 deletions
|
|
@ -33,11 +33,13 @@ audio_test_src_create_sine_##type (struct impl *this, type *samples, size_t n_sa
|
|||
amp = this->props.volume * scale; \
|
||||
\
|
||||
for (i = 0; i < n_samples; i++) { \
|
||||
type val; \
|
||||
this->accumulator += step; \
|
||||
if (this->accumulator >= M_PI_M2) \
|
||||
this->accumulator -= M_PI_M2; \
|
||||
val = (type) (sin (this->accumulator) * amp); \
|
||||
for (c = 0; c < channels; ++c) \
|
||||
*samples++ = (type) (sin (this->accumulator) * amp); \
|
||||
*samples++ = val; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue