[polypaudio-commits] r572 - /trunk/src/polypcore/source.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Wed Feb 22 17:17:55 PST 2006
Author: lennart
Date: Thu Feb 23 02:17:54 2006
New Revision: 572
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=572&root=polypaudio&view=rev
Log:
fix source volume adjustment: copy memchunk before changing the volume of it
Modified:
trunk/src/polypcore/source.c
Modified: trunk/src/polypcore/source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/source.c?rev=572&root=polypaudio&r1=571&r2=572&view=diff
==============================================================================
--- trunk/src/polypcore/source.c (original)
+++ trunk/src/polypcore/source.c Thu Feb 23 02:17:54 2006
@@ -33,6 +33,7 @@
#include <polypcore/xmalloc.h>
#include <polypcore/core-subscribe.h>
#include <polypcore/log.h>
+#include <polypcore/sample-util.h>
#include "source.h"
@@ -182,11 +183,15 @@
pa_source_ref(s);
if (!pa_cvolume_is_norm(&s->sw_volume)) {
- pa_memchunk_make_writable(chunk, s->core->memblock_stat, 0);
- pa_volume_memchunk(chunk, &s->sample_spec, &s->sw_volume);
- }
-
- pa_idxset_foreach(s->outputs, do_post, (void*) chunk);
+ pa_memchunk vchunk = *chunk;
+
+ pa_memblock_ref(vchunk.memblock);
+ pa_memchunk_make_writable(&vchunk, s->core->memblock_stat, 0);
+ pa_volume_memchunk(&vchunk, &s->sample_spec, &s->sw_volume);
+ pa_idxset_foreach(s->outputs, do_post, &vchunk);
+ pa_memblock_unref(vchunk.memblock);
+ } else
+ pa_idxset_foreach(s->outputs, do_post, (void*) chunk);
pa_source_unref(s);
}
More information about the pulseaudio-commits
mailing list