aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-10-10 09:06:28 +0200
committerMax Kellermann <max@duempel.org>2011-10-10 10:13:43 +0200
commit1fb3fbb4de11984c708b4b6355b172cda2b94d43 (patch)
tree896c646016e179da80bad254b9d286b342f0a3e6
parent2c38d19af27ad001876b606950efc0598dd067fb (diff)
downloadmpd-1fb3fbb4de11984c708b4b6355b172cda2b94d43.tar.gz
mpd-1fb3fbb4de11984c708b4b6355b172cda2b94d43.tar.xz
mpd-1fb3fbb4de11984c708b4b6355b172cda2b94d43.zip
audio_format: un-inline audio_format_mask_apply()
This function is not critical for performance, and the inline expansion looks too expensive.
Diffstat (limited to '')
-rw-r--r--src/audio_format.c19
-rw-r--r--src/audio_format.h19
2 files changed, 21 insertions, 17 deletions
diff --git a/src/audio_format.c b/src/audio_format.c
index 799e0dd89..458ec3b13 100644
--- a/src/audio_format.c
+++ b/src/audio_format.c
@@ -28,6 +28,25 @@
#define REVERSE_ENDIAN_SUFFIX "_be"
#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 *
sample_format_to_string(enum sample_format format)
{
diff --git a/src/audio_format.h b/src/audio_format.h
index 8c2906d5f..43bfe2d6a 100644
--- a/src/audio_format.h
+++ b/src/audio_format.h
@@ -221,24 +221,9 @@ static inline bool audio_format_equals(const struct audio_format *a,
a->reverse_endian == b->reverse_endian;
}
-static inline void
+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 struct audio_format *mask);
G_GNUC_CONST
static inline unsigned