mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
pstream: Pass frame size to keep split memblock parts aligned
`pa_pstream_send_memblock()` would split incoming memblock into parts not exceeding maximum pool block size. To make sure split parts of memblock are still frame-aligned add new `align` arg to `pa_pstream_send_memblock`, find out required alignment from stream sample format and pass it there. Bump default alignment to 256 which is good up to 32bit 64ch frames. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/780>
This commit is contained in:
parent
5830e03036
commit
300db77922
5 changed files with 16 additions and 7 deletions
|
|
@ -1535,7 +1535,7 @@ int pa_stream_write_ext_free(
|
|||
s->write_memblock = NULL;
|
||||
s->write_data = NULL;
|
||||
|
||||
pa_pstream_send_memblock(s->context->pstream, s->channel, offset, seek, &chunk);
|
||||
pa_pstream_send_memblock(s->context->pstream, s->channel, offset, seek, &chunk, pa_frame_size(&s->sample_spec));
|
||||
pa_memblock_unref(chunk.memblock);
|
||||
|
||||
} else {
|
||||
|
|
@ -1569,7 +1569,7 @@ int pa_stream_write_ext_free(
|
|||
pa_memblock_release(chunk.memblock);
|
||||
}
|
||||
|
||||
pa_pstream_send_memblock(s->context->pstream, s->channel, t_offset, t_seek, &chunk);
|
||||
pa_pstream_send_memblock(s->context->pstream, s->channel, t_offset, t_seek, &chunk, pa_frame_size(&s->sample_spec));
|
||||
|
||||
t_offset = 0;
|
||||
t_seek = PA_SEEK_RELATIVE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue