diff options
author | Diego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2009-06-24 18:24:45 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-06-29 17:40:42 +0200 |
commit | ad4e025ef5257baeb48e670b03522758ca68f5cf (patch) | |
tree | ba2ae27f2806c722f68a9cc0de6e3935b5ee73cf | |
parent | 595f80fef79bf95bd1c20aad9dc31d6d937a3643 (diff) |
Implement mix-test for s24le and s24be sample formats.
-rw-r--r-- | src/tests/mix-test.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/tests/mix-test.c b/src/tests/mix-test.c index b1dac3bd..c7a30d67 100644 --- a/src/tests/mix-test.c +++ b/src/tests/mix-test.c @@ -79,6 +79,16 @@ static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) { break; } + case PA_SAMPLE_S24NE: + case PA_SAMPLE_S24RE: { + uint8_t *u = d; + + for (i = 0; i < chunk->length / pa_frame_size(ss); i++) + printf("0x%02x%02x%02xx ", *(u++), *(u++), *(u++)); + + break; + } + case PA_SAMPLE_FLOAT32NE: case PA_SAMPLE_FLOAT32RE: { float *u = d; @@ -141,6 +151,25 @@ static pa_memblock* generate_block(pa_mempool *pool, const pa_sample_spec *ss) { break; } + case PA_SAMPLE_S24NE: + case PA_SAMPLE_S24RE: { + /* Need to be on a byte array because they are not aligned */ + static const uint8_t u24_samples[] = + { 0x00, 0x00, 0x01, + 0xFF, 0xFF, 0x02, + 0x7F, 0xFF, 0x03, + 0x80, 0x00, 0x04, + 0x9f, 0xff, 0x05, + 0x3f, 0xff, 0x06, + 0x01, 0x00, 0x07, + 0xF0, 0x00, 0x08, + 0x20, 0x00, 0x09, + 0x21, 0x00, 0x0A }; + + memcpy(d, &u24_samples[0], sizeof(u24_samples)); + break; + } + case PA_SAMPLE_FLOAT32NE: case PA_SAMPLE_FLOAT32RE: { float *u = d; |