[pulseaudio-commits] r1864 - /branches/lennart/src/modules/rtp/rtp.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Tue Sep 18 16:24:14 PDT 2007
Author: lennart
Date: Wed Sep 19 01:24:13 2007
New Revision: 1864
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1864&root=pulseaudio&view=rev
Log:
properly release memblock always abd as soon as possible
Modified:
branches/lennart/src/modules/rtp/rtp.c
Modified: branches/lennart/src/modules/rtp/rtp.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/modules/rtp/rtp.c?rev=1864&root=pulseaudio&r1=1863&r2=1864&view=diff
==============================================================================
--- branches/lennart/src/modules/rtp/rtp.c (original)
+++ branches/lennart/src/modules/rtp/rtp.c Wed Sep 19 01:24:13 2007
@@ -166,7 +166,7 @@
pa_assert(c);
pa_assert(chunk);
- chunk->memblock = NULL;
+ pa_memchunk_reset(chunk);
if (ioctl(c->fd, FIONREAD, &size) < 0) {
pa_log_warn("FIONREAD failed: %s", pa_cstrerror(errno));
@@ -189,7 +189,10 @@
m.msg_controllen = 0;
m.msg_flags = 0;
- if ((r = recvmsg(c->fd, &m, 0)) != size) {
+ r = recvmsg(c->fd, &m, 0);
+ pa_memblock_release(chunk->memblock);
+
+ if (r != size) {
if (r < 0 && errno != EAGAIN && errno != EINTR)
pa_log_warn("recvmsg() failed: %s", r < 0 ? pa_cstrerror(errno) : "size mismatch");
@@ -244,10 +247,8 @@
return 0;
fail:
- if (chunk->memblock) {
- pa_memblock_release(chunk->memblock);
+ if (chunk->memblock)
pa_memblock_unref(chunk->memblock);
- }
return -1;
}
More information about the pulseaudio-commits
mailing list