[pulseaudio-discuss] [PATCH v2 4/4] pacat: Handle holes in recording streams.
Tanu Kaskinen
tanuk at iki.fi
Fri Nov 9 08:46:31 PST 2012
On Thu, 2012-11-08 at 22:27 +0530, Arun Raghavan wrote:
> On Wed, 2012-11-07 at 16:52 +0200, Tanu Kaskinen wrote:
> [...]
> > - if (buffer) {
> > + /* If there is a hole in the stream, we generate silence, except
> > + * if it's a passthrough stream in which case we skip the hole. */
> > + if (data || !(flags & PA_STREAM_PASSTHROUGH)) {
> > buffer = pa_xrealloc(buffer, buffer_length + length);
> > - memcpy((uint8_t*) buffer + buffer_length, data, length);
> > + if (data)
> > + memcpy((uint8_t *) buffer + buffer_length, data, length);
> > + else
> > + pa_silence_memory((uint8_t *) buffer + buffer_length, length, &sample_spec);
> > +
>
> I'm wondering if we should generate zero'ed blocks for passthrough as
> well - otherwise there is no way to know that there was a discontinuity.
> That sucks, but it's a sucky situation anyway, and it's probably better
> to know that things have broken explicitly.
I have hard time believing that anyone would want pulseaudio to insert
deliberately invalid data to a stream. Skipping is not nice, but invalid
data is worse (and doesn't really mitigate the skip that is there
anyway).
--
Tanu
More information about the pulseaudio-discuss
mailing list