[pulseaudio-discuss] [PATCH RFCv3 35/51] sample: Make pa_channels_valid() inlineable

David Henningsson david.henningsson at canonical.com
Thu Nov 6 07:15:33 PST 2014


Uhm, doesn't this break the ABI? I e, the exported symbol 
"pa_channels_valid" will no longer exist in libpulse.so, causing 
existing apps to crash, unless they recompile against the new headers?

On 2014-11-05 00:26, Peter Meerwald wrote:
> Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
> ---
>   src/pulse/sample.c | 4 ----
>   src/pulse/sample.h | 4 +++-
>   2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/src/pulse/sample.c b/src/pulse/sample.c
> index 0d81a32..52ded48 100644
> --- a/src/pulse/sample.c
> +++ b/src/pulse/sample.c
> @@ -111,10 +111,6 @@ int pa_sample_rate_valid(uint32_t rate) {
>       return rate > 0 && rate <= PA_RATE_MAX;
>   }
>
> -int pa_channels_valid(uint8_t channels) {
> -    return channels > 0 && channels <= PA_CHANNELS_MAX;
> -}
> -
>   int pa_sample_spec_valid(const pa_sample_spec *spec) {
>       pa_assert(spec);
>
> diff --git a/src/pulse/sample.h b/src/pulse/sample.h
> index 86973d4..86f65b1 100644
> --- a/src/pulse/sample.h
> +++ b/src/pulse/sample.h
> @@ -297,7 +297,9 @@ int pa_sample_rate_valid(uint32_t rate) PA_GCC_PURE;
>
>   /** Return non-zero if the channel count is within the supported range.
>    * \since 5.0 */
> -int pa_channels_valid(uint8_t channels) PA_GCC_PURE;
> +static inline int pa_channels_valid(uint8_t channels) {
> +    return channels > 0 && channels <= PA_CHANNELS_MAX;
> +}
>
>   /** Return non-zero when the sample type specification is valid */
>   int pa_sample_spec_valid(const pa_sample_spec *spec) PA_GCC_PURE;
>

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


More information about the pulseaudio-discuss mailing list