audio_format: un-inline audio_format_mask_apply()

This function is not critical for performance, and the inline
expansion looks too expensive.
This commit is contained in:
Max Kellermann 2011-10-10 09:06:28 +02:00
parent 2c38d19af2
commit 1fb3fbb4de
2 changed files with 21 additions and 17 deletions

View File

@ -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)
{ {

View File

@ -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