mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
remove export/import objects when SHM is disable for a pa_pstream object
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1275 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
fd3fe96ce5
commit
7ac79098a6
1 changed files with 20 additions and 5 deletions
|
|
@ -476,7 +476,6 @@ static void prepare_next_write_item(pa_pstream *p) {
|
|||
#ifdef HAVE_CREDS
|
||||
if ((p->send_creds_now = p->write.current->with_creds))
|
||||
p->write_creds = p->write.current->creds;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -860,9 +859,25 @@ void pa_pstream_use_shm(pa_pstream *p, int enable) {
|
|||
|
||||
p->use_shm = enable;
|
||||
|
||||
if (!p->import)
|
||||
p->import = pa_memimport_new(p->mempool, memimport_release_cb, p);
|
||||
if (enable) {
|
||||
|
||||
if (!p->export)
|
||||
p->export = pa_memexport_new(p->mempool, memexport_revoke_cb, p);
|
||||
if (!p->import)
|
||||
p->import = pa_memimport_new(p->mempool, memimport_release_cb, p);
|
||||
|
||||
if (!p->export)
|
||||
p->export = pa_memexport_new(p->mempool, memexport_revoke_cb, p);
|
||||
|
||||
} else {
|
||||
|
||||
if (p->import) {
|
||||
pa_memimport_free(p->import);
|
||||
p->import = NULL;
|
||||
}
|
||||
|
||||
if (p->export) {
|
||||
pa_memexport_free(p->export);
|
||||
p->export = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue