mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
stream: only unmap data that was mapped and mappable.
This commit is contained in:
parent
0b42ec714d
commit
45984fef77
2 changed files with 14 additions and 7 deletions
|
|
@ -780,9 +780,12 @@ static void clear_buffers(struct port *port)
|
||||||
if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_MAPPED)) {
|
if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_MAPPED)) {
|
||||||
for (j = 0; j < b->this.buffer->n_datas; j++) {
|
for (j = 0; j < b->this.buffer->n_datas; j++) {
|
||||||
struct spa_data *d = &b->this.buffer->datas[j];
|
struct spa_data *d = &b->this.buffer->datas[j];
|
||||||
pw_log_debug("%p: clear buffer %d mem",
|
if (SPA_FLAG_IS_SET(d->flags, SPA_DATA_FLAG_MAPPABLE) ||
|
||||||
impl, b->id);
|
(mappable_dataTypes & (1<<d->type)) > 0) {
|
||||||
unmap_data(impl, d);
|
pw_log_debug("%p: clear buffer %d mem",
|
||||||
|
impl, b->id);
|
||||||
|
unmap_data(impl, d);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -945,7 +948,8 @@ static int impl_port_use_buffers(void *object,
|
||||||
if (SPA_FLAG_IS_SET(impl_flags, PW_FILTER_PORT_FLAG_MAP_BUFFERS)) {
|
if (SPA_FLAG_IS_SET(impl_flags, PW_FILTER_PORT_FLAG_MAP_BUFFERS)) {
|
||||||
for (j = 0; j < buffers[i]->n_datas; j++) {
|
for (j = 0; j < buffers[i]->n_datas; j++) {
|
||||||
struct spa_data *d = &buffers[i]->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)
|
if ((res = map_data(impl, d, prot)) < 0)
|
||||||
return res;
|
return res;
|
||||||
SPA_FLAG_SET(b->flags, BUFFER_FLAG_MAPPED);
|
SPA_FLAG_SET(b->flags, BUFFER_FLAG_MAPPED);
|
||||||
|
|
|
||||||
|
|
@ -865,9 +865,12 @@ static void clear_buffers(struct pw_stream *stream)
|
||||||
if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_MAPPED)) {
|
if (SPA_FLAG_IS_SET(b->flags, BUFFER_FLAG_MAPPED)) {
|
||||||
for (j = 0; j < b->this.buffer->n_datas; j++) {
|
for (j = 0; j < b->this.buffer->n_datas; j++) {
|
||||||
struct spa_data *d = &b->this.buffer->datas[j];
|
struct spa_data *d = &b->this.buffer->datas[j];
|
||||||
pw_log_debug("%p: clear buffer %d mem",
|
if (SPA_FLAG_IS_SET(d->flags, SPA_DATA_FLAG_MAPPABLE) ||
|
||||||
stream, b->id);
|
(mappable_dataTypes & (1<<d->type)) > 0) {
|
||||||
unmap_data(impl, d);
|
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