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

Arun Raghavan arun at accosted.net
Tue Dec 15 20:22:29 PST 2015


On 16 December 2015 at 00:36, Tanu Kaskinen <tanuk at iki.fi> wrote:
> 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.

I misread that code. It does work with the chunk, not the memblock of course.

-- Arun


More information about the pulseaudio-discuss mailing list