padsp: Handle holes in recording streams.

This commit is contained in:
Tanu Kaskinen 2012-11-07 16:52:39 +02:00
parent dbb94daa0b
commit 94ac039b87

View file

@ -922,9 +922,22 @@ static int fd_info_copy_data(fd_info *i, int force) {
return -1;
}
if (!data)
if (len <= 0)
break;
if (!data) {
/* Maybe we should generate silence here, but I'm lazy and
* I'll just skip any holes in the stream. */
if (pa_stream_drop(i->rec_stream) < 0) {
debug(DEBUG_LEVEL_NORMAL, __FILE__": pa_stream_drop(): %s\n", pa_strerror(pa_context_errno(i->context)));
return -1;
}
assert(n >= len);
n -= len;
continue;
}
buf = (const char*)data + i->rec_offset;
if ((r = write(i->thread_fd, buf, len - i->rec_offset)) <= 0) {