summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-11-11 04:18:10 +0100
committerLennart Poettering <lennart@poettering.net>2009-11-11 05:27:10 +0100
commited5af775b1f150aa1717964afd452c382ed85152 (patch)
treebcbe11bd6d9eb1026300a89b16654f957992c514
parent9ad567167ef6abf4598a83edabf4f6aa9642d86f (diff)
core: adjust volume only when there is actually a memory block
Fixes an assert that is hit in somne niche cases: https://bugzilla.redhat.com/show_bug.cgi?id=533482
-rw-r--r--src/pulsecore/sink-input.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 1af2823f..aa84ccb1 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -717,14 +717,15 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink frames */, p
pa_memchunk rchunk;
pa_resampler_run(i->thread_info.resampler, &wchunk, &rchunk);
- if (nvfs) {
- pa_memchunk_make_writable(&rchunk, 0);
- pa_volume_memchunk(&rchunk, &i->sink->sample_spec, &i->volume_factor_sink);
- }
-
/* pa_log_debug("pushing %lu", (unsigned long) rchunk.length); */
if (rchunk.memblock) {
+
+ if (nvfs) {
+ pa_memchunk_make_writable(&rchunk, 0);
+ pa_volume_memchunk(&rchunk, &i->sink->sample_spec, &i->volume_factor_sink);
+ }
+
pa_memblockq_push_align(i->thread_info.render_memblockq, &rchunk);
pa_memblock_unref(rchunk.memblock);
}