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

Peter Meerwald pmeerw at pmeerw.net
Fri Oct 24 14:21:38 PDT 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 fd8f5d5..400df42 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