[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] memblockq: Drop check for chunk index alignment, require aligned length
PulseAudio Marge Bot (@pulseaudio-merge-bot)
gitlab at gitlab.freedesktop.org
Sun Feb 26 19:44:32 UTC 2023
PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio
Commits:
15e76a69 by Igor V. Kovalenko at 2023-02-26T19:42:03+00:00
memblockq: Drop check for chunk index alignment, require aligned length
There is no requirement for chunk index to be aligned, we only need chunk length
to be multiple of sample frame size.
Fixes: 6434853b0 ("memblockq: Do not allow non-frame indices in the memblock queue")
Fixes: 22827a5e1 ("protocol-native: Fail if trying to push unaligned memblock into queue")
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/779>
- - - - -
2 changed files:
- src/pulsecore/memblockq.c
- src/pulsecore/protocol-native.c
Changes:
=====================================
src/pulsecore/memblockq.c
=====================================
@@ -286,7 +286,6 @@ int pa_memblockq_push(pa_memblockq* bq, const pa_memchunk *uchunk) {
pa_assert(uchunk->index + uchunk->length <= pa_memblock_get_length(uchunk->memblock));
pa_assert(uchunk->length % bq->base == 0);
- pa_assert(uchunk->index % bq->base == 0);
if (!can_push(bq, uchunk->length))
return -1;
=====================================
src/pulsecore/protocol-native.c
=====================================
@@ -5068,9 +5068,9 @@ static void pstream_memblock_callback(pa_pstream *p, uint32_t channel, int64_t o
playback_stream *ps = PLAYBACK_STREAM(stream);
size_t frame_size = pa_frame_size(&ps->sink_input->sample_spec);
- if (chunk->index % frame_size != 0 || chunk->length % frame_size != 0) {
- pa_log_warn("Client sent non-aligned memblock: index %d, length %d, frame size: %d",
- (int) chunk->index, (int) chunk->length, (int) frame_size);
+ if (chunk->length % frame_size != 0) {
+ pa_log_warn("Client sent non-aligned memblock: length %d, frame size: %d",
+ (int) chunk->length, (int) frame_size);
return;
}
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/15e76a69bfa5cc5cd90e9b6913c1b9ea366ff5ee
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/15e76a69bfa5cc5cd90e9b6913c1b9ea366ff5ee
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20230226/129b5744/attachment-0001.htm>
More information about the pulseaudio-commits
mailing list