[pulseaudio-discuss] [PATCH RFCv3 14/51] pstream: Only reset memchunk if it has been used

Peter Meerwald pmeerw at pmeerw.net
Tue Nov 4 15:26:09 PST 2014


From: Peter Meerwald <p.meerwald at bct-electronic.com>

Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
---
 src/pulsecore/pstream.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/pulsecore/pstream.c b/src/pulsecore/pstream.c
index b0fda58..69f9abd 100644
--- a/src/pulsecore/pstream.c
+++ b/src/pulsecore/pstream.c
@@ -712,10 +712,10 @@ static int do_write(pa_pstream *p) {
         item_free(p->write.current);
         p->write.current = NULL;
 
-        if (p->write.memchunk.memblock)
+        if (p->write.memchunk.memblock) {
             pa_memblock_unref(p->write.memchunk.memblock);
-
-        pa_memchunk_reset(&p->write.memchunk);
+            pa_memchunk_reset(&p->write.memchunk);
+        }
 
         if (p->drain_callback && !pa_pstream_is_pending(p))
             p->drain_callback(p, p->drain_callback_userdata);
-- 
1.9.1



More information about the pulseaudio-discuss mailing list