mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
padsp: Handle holes in recording streams.
This commit is contained in:
parent
dbb94daa0b
commit
94ac039b87
1 changed files with 14 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue