diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-09-16 22:07:41 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-09-16 22:07:41 +0000 |
commit | daf3938a9e5b50c3e52c0ae889e4d02b548fa78a (patch) | |
tree | 8085694bc8fa63ecb9f6e02288ce961ff7cf5d04 /polyp/pstream.c | |
parent | f9e2058820c2a51994708ad11d1ed8e09b12b8b1 (diff) |
add support for subscribing to autoload table changes
fix module-combine so that the sample rate of at least one streams is not changed from the original
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@206 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/pstream.c')
-rw-r--r-- | polyp/pstream.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/polyp/pstream.c b/polyp/pstream.c index 4ee296ce..b0de9e8c 100644 --- a/polyp/pstream.c +++ b/polyp/pstream.c @@ -101,6 +101,10 @@ static void do_read(struct pa_pstream *p); static void do_something(struct pa_pstream *p) { assert(p); + + if (p->dead) + return; + p->mainloop->defer_enable(p->defer_event, 0); pa_pstream_ref(p); @@ -213,8 +217,11 @@ static void pstream_free(struct pa_pstream *p) { void pa_pstream_send_packet(struct pa_pstream*p, struct pa_packet *packet) { struct item_info *i; - assert(p && packet); + assert(p && packet && p->ref >= 1); + if (p->dead) + return; + /* pa_log(__FILE__": push-packet %p\n", packet); */ i = pa_xmalloc(sizeof(struct item_info)); @@ -227,8 +234,11 @@ void pa_pstream_send_packet(struct pa_pstream*p, struct pa_packet *packet) { void pa_pstream_send_memblock(struct pa_pstream*p, uint32_t channel, uint32_t delta, const struct pa_memchunk *chunk) { struct item_info *i; - assert(p && channel != (uint32_t) -1 && chunk); + assert(p && channel != (uint32_t) -1 && chunk && p->ref >= 1); + if (p->dead) + return; + /* pa_log(__FILE__": push-memblock %p\n", chunk); */ i = pa_xmalloc(sizeof(struct item_info)); |