Commit 1fb3fbb4 authored by Max Kellermann's avatar Max Kellermann

audio_format: un-inline audio_format_mask_apply()

This function is not critical for performance, and the inline expansion looks too expensive.
parent 2c38d19a
...@@ -28,6 +28,25 @@ ...@@ -28,6 +28,25 @@
#define REVERSE_ENDIAN_SUFFIX "_be" #define REVERSE_ENDIAN_SUFFIX "_be"
#endif #endif
void
audio_format_mask_apply(struct audio_format *af,
const struct audio_format *mask)
{
assert(audio_format_valid(af));
assert(audio_format_mask_valid(mask));
if (mask->sample_rate != 0)
af->sample_rate = mask->sample_rate;
if (mask->format != SAMPLE_FORMAT_UNDEFINED)
af->format = mask->format;
if (mask->channels != 0)
af->channels = mask->channels;
assert(audio_format_valid(af));
}
const char * const char *
sample_format_to_string(enum sample_format format) sample_format_to_string(enum sample_format format)
{ {
......
...@@ -221,24 +221,9 @@ static inline bool audio_format_equals(const struct audio_format *a, ...@@ -221,24 +221,9 @@ static inline bool audio_format_equals(const struct audio_format *a,
a->reverse_endian == b->reverse_endian; a->reverse_endian == b->reverse_endian;
} }
static inline void void
audio_format_mask_apply(struct audio_format *af, audio_format_mask_apply(struct audio_format *af,
const struct audio_format *mask) const struct audio_format *mask);
{
assert(audio_format_valid(af));
assert(audio_format_mask_valid(mask));
if (mask->sample_rate != 0)
af->sample_rate = mask->sample_rate;
if (mask->format != SAMPLE_FORMAT_UNDEFINED)
af->format = mask->format;
if (mask->channels != 0)
af->channels = mask->channels;
assert(audio_format_valid(af));
}
G_GNUC_CONST G_GNUC_CONST
static inline unsigned static inline unsigned
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment