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