stream: Frame-align divided audio segments
authorAhmed S. Darwish <darwish.07@gmail.com>
Tue, 22 Nov 2016 20:18:56 +0000 (22:18 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Thu, 24 Nov 2016 18:40:07 +0000 (20:40 +0200)
commit058f223a99acc1e7f74ff190f43ef6ad4f4a8134
treeaf7b9c439777edecc9320d0a53d9c3c892dfbdfb
parentf5315113a5932a44b219c872fec589ded9d3e991
stream: Frame-align divided audio segments

Executing below command will not produce any audio:

  pacat  --channels=3 /dev/urandom

Turns out that pa_stream_write() breaks large audio buffers into
segments of the maximum memblock size available -- a value which
is not necessarily frame aligned.

Meanwhile the server discards any non-aligned client audio, as a
security measure, due to some earlier reported daemon crashes.
Thus divide sent audio to the expected aligned form.

CommitReference-1: 22827a5e1e62
CommitReference-2: 150ace90f380
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=98475
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=77595
Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
src/pulse/stream.c