mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-13 04:27:51 -05:00
stream: only unmap data that was mapped and mappable.
This commit is contained in:
parent
ecb35b976f
commit
822b8114b5
2 changed files with 14 additions and 7 deletions
|
|
@ -779,9 +779,12 @@ static void clear_buffers(struct port *port)
|
|||
if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_MAPPED)) {
|
||||
for (j = 0; j < b->this.buffer->n_datas; j++) {
|
||||
struct spa_data *d = &b->this.buffer->datas[j];
|
||||
pw_log_debug("%p: clear buffer %d mem",
|
||||
impl, b->id);
|
||||
unmap_data(impl, d);
|
||||
if (SPA_FLAG_IS_SET(d->flags, SPA_DATA_FLAG_MAPPABLE) ||
|
||||
(mappable_dataTypes & (1<<d->type)) > 0) {
|
||||
pw_log_debug("%p: clear buffer %d mem",
|
||||
impl, b->id);
|
||||
unmap_data(impl, d);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -944,7 +947,8 @@ static int impl_port_use_buffers(void *object,
|
|||
if (SPA_FLAG_IS_SET(impl_flags, PW_FILTER_PORT_FLAG_MAP_BUFFERS)) {
|
||||
for (j = 0; j < buffers[i]->n_datas; j++) {
|
||||
struct spa_data *d = &buffers[i]->datas[j];
|
||||
if ((mappable_dataTypes & (1<<d->type)) > 0) {
|
||||
if (SPA_FLAG_IS_SET(d->flags, SPA_DATA_FLAG_MAPPABLE) ||
|
||||
(mappable_dataTypes & (1<<d->type)) > 0) {
|
||||
if ((res = map_data(impl, d, prot)) < 0)
|
||||
return res;
|
||||
SPA_FLAG_SET(b->flags, BUFFER_FLAG_MAPPED);
|
||||
|
|
|
|||
|
|
@ -857,9 +857,12 @@ static void clear_buffers(struct pw_stream *stream)
|
|||
if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_MAPPED)) {
|
||||
for (j = 0; j < b->this.buffer->n_datas; j++) {
|
||||
struct spa_data *d = &b->this.buffer->datas[j];
|
||||
pw_log_debug("%p: clear buffer %d mem",
|
||||
stream, b->id);
|
||||
unmap_data(impl, d);
|
||||
if (SPA_FLAG_IS_SET(d->flags, SPA_DATA_FLAG_MAPPABLE) ||
|
||||
(mappable_dataTypes & (1<<d->type)) > 0) {
|
||||
pw_log_debug("%p: clear buffer %d mem",
|
||||
stream, b->id);
|
||||
unmap_data(impl, d);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue