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)
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;
}
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;
}
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);