mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
module-profiler: make sure we don't overrun the flush buffer
Check that the node profiler data fits in the flush buffer.
This commit is contained in:
parent
0cbcf88eaa
commit
121228bde8
1 changed files with 7 additions and 5 deletions
|
|
@ -134,12 +134,14 @@ static void do_flush_event(void *data, uint64_t count)
|
|||
pw_log_trace("%p avail %d", impl, avail);
|
||||
|
||||
if (avail > 0) {
|
||||
spa_ringbuffer_read_data(&n->buffer, n->data, DATA_BUFFER,
|
||||
idx % DATA_BUFFER,
|
||||
SPA_PTROFF(p, sizeof(struct spa_pod_struct) + total, void),
|
||||
avail);
|
||||
if (total + avail < FLUSH_BUFFER) {
|
||||
spa_ringbuffer_read_data(&n->buffer, n->data, DATA_BUFFER,
|
||||
idx % DATA_BUFFER,
|
||||
SPA_PTROFF(p, sizeof(struct spa_pod_struct) + total, void),
|
||||
avail);
|
||||
total += avail;
|
||||
}
|
||||
spa_ringbuffer_read_update(&n->buffer, idx + avail);
|
||||
total += avail;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue