diff options
author | Niels Ole Salscheider <niels_ole@salscheider-online.de> | 2012-11-24 12:32:51 +0100 |
---|---|---|
committer | Tanu Kaskinen <tanuk@iki.fi> | 2012-11-29 05:28:39 +0200 |
commit | 523af5b30220df76515b8b9fa62d0f80bffc541f (patch) | |
tree | cd8b38e0264345c08d738283f3ee6929a11d6966 | |
parent | 41055145d7563c20fd58ed4b0a9b349c2363bb02 (diff) |
virtual-surround: check if resampled memblock is not equal to input
Since commit e32a408b3cdd46857fdf12210c1bf5bdbf3a96f8, we silence the
input memblock in order to give the resampler enough input samples, if
necessary.
But if there is no need to resample the hrir, the resampled memblock is
actually the same as the input memblock. Thus, we have to make sure that
we do not silence it in this case.
-rw-r--r-- | src/modules/module-virtual-surround-sink.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/module-virtual-surround-sink.c b/src/modules/module-virtual-surround-sink.c index 49152783..adaa58f6 100644 --- a/src/modules/module-virtual-surround-sink.c +++ b/src/modules/module-virtual-surround-sink.c @@ -738,8 +738,10 @@ int pa__init(pa_module*m) { /* add silence to the hrir until we get enough samples out of the resampler */ while (hrir_copied_length < hrir_total_length) { pa_resampler_run(resampler, &hrir_temp_chunk, &hrir_temp_chunk_resampled); - /* Silence input block */ - pa_silence_memblock(hrir_temp_chunk.memblock, &hrir_temp_ss); + if (hrir_temp_chunk.memblock != hrir_temp_chunk_resampled.memblock) { + /* Silence input block */ + pa_silence_memblock(hrir_temp_chunk.memblock, &hrir_temp_ss); + } if (hrir_temp_chunk_resampled.memblock) { /* Copy hrir data */ |