raop: Rework packet's store memory management

This patch switch the packet-buffer to use core memory pool instead of
manually allocating the room required for storing TCP/UDP packets. Packets
are now stored using pa_memchunk instead of internal struct. Quite a few
malloc saved compare to previous design.
This commit is contained in:
Martin Blanchard 2016-11-06 12:54:10 -06:00 committed by Tanu Kaskinen
parent 32a5b3047b
commit 750a677b43
4 changed files with 216 additions and 253 deletions

View file

@ -333,7 +333,6 @@ static void thread_func(void *userdata) {
unsigned int i, nbfds = 0;
pa_usec_t now, estimated, intvl;
uint64_t position;
ssize_t written;
size_t index;
int ret;
@ -399,8 +398,7 @@ static void thread_func(void *userdata) {
pa_assert(u->memchunk.length > 0);
index = u->memchunk.index;
written = pa_raop_client_send_audio_packet(u->raop, &u->memchunk, offset);
if (written < 0) {
if (pa_raop_client_send_audio_packet(u->raop, &u->memchunk, offset) < 0) {
if (errno == EINTR) {
/* Just try again. */
pa_log_debug("Failed to write data to FIFO (EINTR), retrying");