[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-89-g35faedb

Lennart Poettering gitmailer-noreply at 0pointer.de
Fri May 8 15:08:02 PDT 2009


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  d7b8947a5e428857ff96f5deead3dea180f69130 (commit)

- Log -----------------------------------------------------------------
35faedb core: Take samples from silence cache rather than write zeros
-----------------------------------------------------------------------

Summary of changes:
 src/pulsecore/sink.c |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)

-----------------------------------------------------------------------

commit 35faedb6e836a4dbc32403dc9688c3bbbd377cb3
Author: Jyri Sarha <jyri.sarha at nokia.com>
Date:   Thu May 7 19:55:57 2009 +0300

    core: Take samples from silence cache rather than write zeros
    
    If the only stream to render from is muted take samples from the
    silence cache. This should shrink memory/cache bandwidth. Again the
    gain was not what I hoped for.

diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index a7e9529..5ac5086 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -787,11 +787,17 @@ void pa_sink_render(pa_sink*s, size_t length, pa_memchunk *result) {
         pa_sw_cvolume_multiply(&volume, &s->thread_info.soft_volume, &info[0].volume);
 
         if (s->thread_info.soft_muted || !pa_cvolume_is_norm(&volume)) {
-            pa_memchunk_make_writable(result, 0);
-            if (s->thread_info.soft_muted || pa_cvolume_is_muted(&volume))
-                pa_silence_memchunk(result, &s->sample_spec);
-            else
+            if (s->thread_info.soft_muted || pa_cvolume_is_muted(&volume)) {
+                pa_memblock_unref(result->memblock);
+                pa_silence_memchunk_get(&s->core->silence_cache,
+                                        s->core->mempool,
+                                        result,
+                                        &s->sample_spec,
+                                        result->length);
+            } else {
+                pa_memchunk_make_writable(result, 0);
                 pa_volume_memchunk(result, &s->sample_spec, &volume);
+            }
         }
     } else {
         void *ptr;
@@ -968,13 +974,19 @@ void pa_sink_render_full(pa_sink *s, size_t length, pa_memchunk *result) {
 
 	pa_sw_cvolume_multiply(&volume, &s->thread_info.soft_volume, &info[0].volume);
 
-	if (s->thread_info.soft_muted || !pa_cvolume_is_norm(&volume)) {
-            pa_memchunk_make_writable(result, length);
-            if (s->thread_info.soft_muted || pa_cvolume_is_muted(&volume))
-                pa_silence_memchunk(result, &s->sample_spec);
-            else
+        if (s->thread_info.soft_muted || !pa_cvolume_is_norm(&volume)) {
+            if (s->thread_info.soft_muted || pa_cvolume_is_muted(&volume)) {
+                pa_memblock_unref(result->memblock);
+                pa_silence_memchunk_get(&s->core->silence_cache,
+                                        s->core->mempool,
+                                        result,
+                                        &s->sample_spec,
+                                        result->length);
+            } else {
+                pa_memchunk_make_writable(result, length);
                 pa_volume_memchunk(result, &s->sample_spec, &volume);
-	}
+            }
+        }
     } else {
         void *ptr;
 

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list