aboutsummaryrefslogtreecommitdiff
path: root/src/audio_format.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-03-16 23:37:41 +0100
committerMax Kellermann <max@duempel.org>2011-03-16 23:37:41 +0100
commit4f293ecd6f4c7a07d72fbf0b9d0d454244b12c2a (patch)
tree830490ade657a93950dbcfba0e606dbaa5092af9 /src/audio_format.h
parentb6303313f0145c4caf58195ba4a85d2f4fa2967c (diff)
audio_format, output_thread: add more audio_format_valid() assertions
Diffstat (limited to 'src/audio_format.h')
-rw-r--r--src/audio_format.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/audio_format.h b/src/audio_format.h
index dd32731c..a4450ad7 100644
--- a/src/audio_format.h
+++ b/src/audio_format.h
@@ -22,6 +22,7 @@
#include <stdint.h>
#include <stdbool.h>
+#include <assert.h>
enum sample_format {
SAMPLE_FORMAT_UNDEFINED = 0,
@@ -219,6 +220,9 @@ static inline 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;
@@ -227,6 +231,8 @@ audio_format_mask_apply(struct audio_format *af,
if (mask->channels != 0)
af->channels = mask->channels;
+
+ assert(audio_format_valid(af));
}
/**