[pulseaudio-discuss] [PATCH v2 4/4] pacat: Handle holes in recording streams.

Arun Raghavan arun.raghavan at collabora.co.uk
Thu Nov 8 08:57:12 PST 2012


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.

-- Arun



More information about the pulseaudio-discuss mailing list