diff --git a/pipewire-jack b/pipewire-jack index 2736c227a..35bf6bfa5 160000 --- a/pipewire-jack +++ b/pipewire-jack @@ -1 +1 @@ -Subproject commit 2736c227a19b1db48dd849af6f7f3e929bb53c00 +Subproject commit 35bf6bfa5c3969b65e63dbfe48578c5c040849d4 diff --git a/src/pipewire/mem.c b/src/pipewire/mem.c index e681eab9f..2422582ec 100644 --- a/src/pipewire/mem.c +++ b/src/pipewire/mem.c @@ -266,13 +266,18 @@ static struct mapping * memblock_map(struct memblock *b, struct mempool *p = SPA_CONTAINER_OF(b->this.pool, struct mempool, this); struct mapping *m; void *ptr; - int prot = 0; + int prot = 0, fl = 0; if (flags & PW_MEMMAP_FLAG_READ) prot |= PROT_READ; if (flags & PW_MEMMAP_FLAG_WRITE) prot |= PROT_WRITE; + if (flags & PW_MEMMAP_FLAG_PRIVATE) + fl |= MAP_PRIVATE; + else + fl |= MAP_SHARED; + if (flags & PW_MEMMAP_FLAG_TWICE) { pw_log_error(NAME" %p: implement me PW_MEMMAP_FLAG_TWICE", p); errno = ENOTSUP; @@ -280,7 +285,7 @@ static struct mapping * memblock_map(struct memblock *b, } - ptr = mmap(NULL, size, prot, MAP_SHARED, b->this.fd, offset); + ptr = mmap(NULL, size, prot, fl, b->this.fd, offset); if (ptr == MAP_FAILED) { pw_log_error(NAME" %p: Failed to mmap memory fd:%d offset:%u size:%u: %m", p, b->this.fd, offset, size); diff --git a/src/pipewire/mem.h b/src/pipewire/mem.h index 7109d616c..5d3946780 100644 --- a/src/pipewire/mem.h +++ b/src/pipewire/mem.h @@ -49,6 +49,7 @@ enum pw_memmap_flags { PW_MEMMAP_FLAG_WRITE = (1 << 1), /**< map in write mode */ PW_MEMMAP_FLAG_TWICE = (1 << 2), /**< map the same area twice afer eachother, * creating a circular ringbuffer */ + PW_MEMMAP_FLAG_PRIVATE = (1 << 3), /**< writes will be private */ PW_MEMMAP_FLAG_READWRITE = PW_MEMMAP_FLAG_READ | PW_MEMMAP_FLAG_WRITE, };