summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2007-03-01 17:11:10 +0000
committerPierre Ossman <ossman@cendio.se>2007-03-01 17:11:10 +0000
commit6ba21d4a0bdc031162a1755a15d5a2088a04fb2f (patch)
tree48622533674e736710e5c473ace3769df34a6692
parentdf47c7b828c02afbabc4d024008fabb07a882397 (diff)
Add some debugging output from sample cache subsystem.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1430 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--src/pulsecore/core-scache.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pulsecore/core-scache.c b/src/pulsecore/core-scache.c
index 75fb47f0..cb272784 100644
--- a/src/pulsecore/core-scache.c
+++ b/src/pulsecore/core-scache.c
@@ -138,6 +138,7 @@ static pa_scache_entry* scache_add_item(pa_core *c, const char *name) {
int pa_scache_add_item(pa_core *c, const char *name, const pa_sample_spec *ss, const pa_channel_map *map, const pa_memchunk *chunk, uint32_t *idx) {
pa_scache_entry *e;
+ char st[PA_SAMPLE_SPEC_SNPRINT_MAX];
assert(c && name);
if (chunk && chunk->length > PA_SCACHE_ENTRY_SIZE_MAX)
@@ -163,6 +164,10 @@ int pa_scache_add_item(pa_core *c, const char *name, const pa_sample_spec *ss, c
if (idx)
*idx = e->index;
+ pa_log_debug("created sample \"%s\" (#%d), %d bytes with sample spec %s",
+ name, e->index, e->memchunk.length,
+ pa_sample_spec_snprint(st, sizeof(st), &e->sample_spec));
+
return 0;
}
@@ -229,7 +234,10 @@ int pa_scache_remove_item(pa_core *c, const char *name) {
if (pa_idxset_remove_by_data(c->scache, e, NULL) != e)
assert(0);
+ pa_log_debug("removed sample \"%s\"", name);
+
free_entry(e);
+
return 0;
}
@@ -276,6 +284,8 @@ int pa_scache_play_item(pa_core *c, const char *name, pa_sink *sink, pa_volume_t
if (!e->memchunk.memblock)
return -1;
+ pa_log_debug("playing sample \"%s\" on \"%s\"", name, sink->name);
+
t = pa_sprintf_malloc("sample:%s", name);
pa_cvolume_set(&r, e->volume.channels, volume);