[PATCH 3/8] sink, source: Don't care about default and alternate rate in passthrough mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/09/2013 08:57 AM, Tanu Kaskinen wrote:
> In passthrough mode the device rate is set to match the stream rate,
> and the default and alternate rates are ignored.
> ---
>  src/pulsecore/sink.c   | 2 +-
>  src/pulsecore/source.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
> index 2f5174e..a4ad21a 100644
> --- a/src/pulsecore/sink.c
> +++ b/src/pulsecore/sink.c
> @@ -1389,7 +1389,7 @@ bool pa_sink_update_rate(pa_sink *s, uint32_t rate, bool passthrough) {
>      if (!s->update_rate)
>          return false;
>  
> -    if (PA_UNLIKELY(default_rate == alternate_rate)) {
> +    if (PA_UNLIKELY(default_rate == alternate_rate && !passthrough)) {
>          pa_log_warn("Default and alternate sample rates are the same.");

I think this message could go away altogether. There are plenty of
scenarios where you prefer to always use one sample rate.

But if you like it the way it is, feel free to push.

>          return false;
>      }
> diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
> index c7f0127..55f85d0 100644
> --- a/src/pulsecore/source.c
> +++ b/src/pulsecore/source.c
> @@ -979,7 +979,7 @@ bool pa_source_update_rate(pa_source *s, uint32_t rate, bool passthrough) {
>      if (!s->update_rate && !s->monitor_of)
>          return false;
>  
> -    if (PA_UNLIKELY(default_rate == alternate_rate)) {
> +    if (PA_UNLIKELY(default_rate == alternate_rate && !passthrough)) {
>          pa_log_warn("Default and alternate sample rates are the same.");
>          return false;
>      }
> 



-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux