[pulseaudio-discuss] [PATCH] sink-input: Don't access resampler to get silence memchunk

Tanu Kaskinen tanuk at iki.fi
Tue Dec 15 11:06:39 PST 2015


On Tue, 2015-12-15 at 21:49 +0530, arun at accosted.net wrote:
> From: Arun Raghavan <git at arunraghavan.net>
> 
> There doesn't appear to be a good reason to restrict the memchunk length
> to the resample max block size -- we're going to have the memory around
> anyway.

I think the reason is to make sure that we don't feed the resampler
bigger chunks than what it can handle. The resampler has to allocate
other memblocks during its operation, and those memblocks may be bigger
than the input block, so if the input block is too large, the
requirements for the other blocks will grow beyond the mempool max
block size.

However, pa_sink_input_peek() seems to protect against this anyway when
doing resampling (it processes the input in smaller pieces if it's
larger than the resampler max block size), so maybe this change is safe
anyway.

> Moreover, callers of pa_sink_input_get_silence() don't seem to
> actually care about the chunk itself, just the memblock for creating
> their own pa_memblockq.

I don't understand this comment. pa_memblockq cares about the chunk
itself, not just the memblock.

-- 
Tanu


More information about the pulseaudio-discuss mailing list