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

Tanu Kaskinen tanuk at iki.fi
Tue Jan 19 02:35:25 PST 2016


On Mon, 2016-01-18 at 12:38 +0530, Arun Raghavan wrote:
> On 16 January 2016 at 13:08, Tanu Kaskinen <tanuk at iki.fi> wrote:
> > On Wed, 2015-12-16 at 09:52 +0530, Arun Raghavan wrote:
> > > 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.
> > 
> > Do you plan to send v2 of this patch some time soon?
> 
> Do you see a need to change anything other than the commit message? I
> can just drop the last sentence.

No, just the commit message needs editing. In addition to dropping the
last sentence, the first sentence could use some editing too, because
it doesn't address what I'm guessing is the real reason why the length
restriction was originally added.

-- 
Tanu


More information about the pulseaudio-discuss mailing list