[PATCH 6/8] rtp: Don't release memblock until we stop accessing underlying data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Arun Raghavan <git@xxxxxxxxxxxxxxxx>

---
 src/modules/rtp/rtp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/modules/rtp/rtp.c b/src/modules/rtp/rtp.c
index e372cbd..5a24a03 100644
--- a/src/modules/rtp/rtp.c
+++ b/src/modules/rtp/rtp.c
@@ -256,7 +256,6 @@ int pa_rtp_recv(pa_rtp_context *c, pa_memchunk *chunk, pa_mempool *pool, uint32_
     m.msg_flags = 0;
 
     r = recvmsg(c->fd, &m, 0);
-    pa_memblock_release(chunk->memblock);
 
     if (r != size) {
         if (r < 0 && errno != EAGAIN && errno != EINTR)
@@ -274,6 +273,8 @@ int pa_rtp_recv(pa_rtp_context *c, pa_memchunk *chunk, pa_mempool *pool, uint32_
     memcpy(rtp_tstamp, (uint8_t*) iov.iov_base + 4, sizeof(uint32_t));
     memcpy(&ssrc, (uint8_t*) iov.iov_base + 8, sizeof(uint32_t));
 
+    pa_memblock_release(chunk->memblock);
+
     header = ntohl(header);
     *rtp_tstamp = ntohl(*rtp_tstamp);
     ssrc = ntohl(c->ssrc);
-- 
2.5.0



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux