memblockq: Improve debuggability by storing a name and a sample spec.

These are not used for anything at this point, but this
makes it easy to add ad-hoc debug prints that show the
memblockq name and to convert between bytes and usecs.
This commit is contained in:
Tanu Kaskinen 2011-09-29 18:54:03 +03:00 committed by Colin Guthrie
parent 4d930f19f9
commit 666261ece8
21 changed files with 89 additions and 46 deletions

View file

@ -76,6 +76,11 @@ int main(int argc, char *argv[]) {
pa_memblockq *bq;
pa_memchunk chunk1, chunk2, chunk3, chunk4;
pa_memchunk silence;
pa_sample_spec ss = {
.format = PA_SAMPLE_S16LE,
.rate = 48000,
.channels = 1
};
pa_log_set_level(PA_LOG_DEBUG);
@ -86,7 +91,7 @@ int main(int argc, char *argv[]) {
silence.index = 0;
silence.length = pa_memblock_get_length(silence.memblock);
bq = pa_memblockq_new(0, 200, 10, 2, 4, 4, 40, &silence);
bq = pa_memblockq_new("test memblockq", 0, 200, 10, &ss, 4, 4, 40, &silence);
assert(bq);
chunk1.memblock = pa_memblock_new_fixed(p, (char*) "11", 2, 1);