summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-02-03 12:23:17 +0000
committerPierre Ossman <ossman@cendio.se>2006-02-03 12:23:17 +0000
commitbbc6dd68e22171670271e694f3a42db736eca60d (patch)
tree206dfdf8c2d85772246f2be0272ee04caaab9d9f
parentc34f35a797590376f8a979c1bfc2a35b3bd80f75 (diff)
Volume adjustment must be done _after_ dropping the chunk since drop will
reject a modified chunk. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@472 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--polyp/sink-input.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/polyp/sink-input.c b/polyp/sink-input.c
index 4a847e46..f447b8cf 100644
--- a/polyp/sink-input.c
+++ b/polyp/sink-input.c
@@ -222,12 +222,6 @@ int pa_sink_input_peek(pa_sink_input *i, pa_memchunk *chunk, pa_cvolume *volume)
goto finish;
assert(tchunk.length);
-
- /* It might be necessary to adjust the volume here */
- if (do_volume_adj_here) {
- pa_memchunk_make_writable(&tchunk, i->sink->core->memblock_stat, 0);
- pa_volume_memchunk(&tchunk, &i->sample_spec, &i->volume);
- }
l = pa_resampler_request(i->resampler, CONVERT_BUFFER_LENGTH);
@@ -237,6 +231,12 @@ int pa_sink_input_peek(pa_sink_input *i, pa_memchunk *chunk, pa_cvolume *volume)
i->drop(i, &tchunk, l);
tchunk.length = l;
+ /* It might be necessary to adjust the volume here */
+ if (do_volume_adj_here) {
+ pa_memchunk_make_writable(&tchunk, i->sink->core->memblock_stat, 0);
+ pa_volume_memchunk(&tchunk, &i->sample_spec, &i->volume);
+ }
+
pa_resampler_run(i->resampler, &tchunk, &i->resampled_chunk);
pa_memblock_unref(tchunk.memblock);
}