[pulseaudio-commits] src/pulsecore

Colin Guthrie colin at kemper.freedesktop.org
Sun Aug 7 09:28:23 PDT 2011


 src/pulsecore/source-output.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 8c93d7dc8079f2433d19efdd73c1279bd32787fc
Author: Colin Guthrie <colin at mageia.org>
Date:   Sat Aug 6 23:05:27 2011 +0200

    source-output: Fix resampling.
    
    When recording, we need to reverse the order of sample specs
    (origin<->destination) from the sink code this was copied form.

diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 59b6c2f..cd2e126 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -733,7 +733,7 @@ void pa_source_output_push(pa_source_output *o, const pa_memchunk *chunk) {
             pa_memchunk_make_writable(&qchunk, 0);
 
             if (o->thread_info.muted) {
-                pa_silence_memchunk(&qchunk, &o->thread_info.sample_spec);
+                pa_silence_memchunk(&qchunk, &o->source->sample_spec);
                 nvfs = FALSE;
 
             } else if (!o->thread_info.resampler && nvfs) {
@@ -743,17 +743,17 @@ void pa_source_output_push(pa_source_output *o, const pa_memchunk *chunk) {
                  * post and the pre volume adjustment into one */
 
                 pa_sw_cvolume_multiply(&v, &o->thread_info.soft_volume, &o->volume_factor_source);
-                pa_volume_memchunk(&qchunk, &o->thread_info.sample_spec, &v);
+                pa_volume_memchunk(&qchunk, &o->source->sample_spec, &v);
                 nvfs = FALSE;
 
             } else
-                pa_volume_memchunk(&qchunk, &o->thread_info.sample_spec, &o->thread_info.soft_volume);
+                pa_volume_memchunk(&qchunk, &o->source->sample_spec, &o->thread_info.soft_volume);
         }
 
         if (!o->thread_info.resampler) {
             if (nvfs) {
                 pa_memchunk_make_writable(&qchunk, 0);
-                pa_volume_memchunk(&qchunk, &o->source->sample_spec, &o->volume_factor_source);
+                pa_volume_memchunk(&qchunk, &o->thread_info.sample_spec, &o->volume_factor_source);
             }
 
             o->push(o, &qchunk);
@@ -771,7 +771,7 @@ void pa_source_output_push(pa_source_output *o, const pa_memchunk *chunk) {
             if (rchunk.length > 0) {
                 if (nvfs) {
                     pa_memchunk_make_writable(&rchunk, 0);
-                    pa_volume_memchunk(&rchunk, &o->source->sample_spec, &o->volume_factor_source);
+                    pa_volume_memchunk(&rchunk, &o->thread_info.sample_spec, &o->volume_factor_source);
                 }
 
                 o->push(o, &rchunk);



More information about the pulseaudio-commits mailing list