[pulseaudio-discuss] [PATCH 4/8] sink, source: Fix default and alternate rate assertions
David Henningsson
david.henningsson at canonical.com
Mon Aug 12 00:20:56 PDT 2013
On 08/09/2013 08:57 AM, Tanu Kaskinen wrote:
> ---
> src/pulsecore/sink.c | 4 ++--
> src/pulsecore/source.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
> index a4ad21a..ae6ae8f 100644
> --- a/src/pulsecore/sink.c
> +++ b/src/pulsecore/sink.c
> @@ -1412,8 +1412,8 @@ bool pa_sink_update_rate(pa_sink *s, uint32_t rate, bool passthrough) {
> return false;
>
> if (!passthrough) {
> - pa_assert(default_rate % 4000 || default_rate % 11025);
> - pa_assert(alternate_rate % 4000 || alternate_rate % 11025);
> + pa_assert((default_rate % 4000 == 0) || (default_rate % 11025 == 0));
> + pa_assert((alternate_rate % 4000 == 0) || (alternate_rate % 11025 == 0));
Looks correct, even though I don't understand why we need these
constraints in the first place. (Why can't we just allow any sample rate
as default or alternate?)
>
> if (default_rate % 4000) {
> /* default is a 11025 multiple */
> diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
> index 55f85d0..a9f515e 100644
> --- a/src/pulsecore/source.c
> +++ b/src/pulsecore/source.c
> @@ -995,8 +995,8 @@ bool pa_source_update_rate(pa_source *s, uint32_t rate, bool passthrough) {
> return false;
>
> if (!passthrough) {
> - pa_assert(default_rate % 4000 || default_rate % 11025);
> - pa_assert(alternate_rate % 4000 || alternate_rate % 11025);
> + pa_assert((default_rate % 4000 == 0) || (default_rate % 11025 == 0));
> + pa_assert((alternate_rate % 4000 == 0) || (alternate_rate % 11025 == 0));
>
> if (default_rate % 4000) {
> /* default is a 11025 multiple */
>
--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
More information about the pulseaudio-discuss
mailing list