This file is part of polypaudio.
polypaudio is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
+ it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with polypaudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
#include "subscribe.h"
#include "namereg.h"
#include "sound-file.h"
+#include "util.h"
#define UNLOAD_POLL_TIME 2
int pa_scache_play_item(struct pa_core *c, const char *name, struct pa_sink *sink, uint32_t volume) {
struct pa_scache_entry *e;
+ char *t;
assert(c && name && sink);
if (!(e = pa_namereg_get(c, name, PA_NAMEREG_SAMPLE, 1)))
if (!e->memchunk.memblock)
return -1;
- if (pa_play_memchunk(sink, name, &e->sample_spec, &e->memchunk, pa_volume_multiply(volume, e->volume)) < 0)
+ t = pa_sprintf_malloc("sample:%s", name);
+ if (pa_play_memchunk(sink, t, &e->sample_spec, &e->memchunk, pa_volume_multiply(volume, e->volume)) < 0) {
+ free(t);
return -1;
+ }
+
+ free(t);
if (e->lazy)
time(&e->last_used_time);
struct pa_scache_entry *e;
assert(c && name);
- if (!(e = pa_namereg_get(c, name, PA_NAMEREG_SAMPLE, 1)))
+ if (!(e = pa_namereg_get(c, name, PA_NAMEREG_SAMPLE, 0)))
return PA_IDXSET_INVALID;
return e->index;