mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-01 22:58:47 -04:00
in case alsa lies to use don't spin forever
This commit is contained in:
parent
ec9f8f10f3
commit
3c73025bf5
2 changed files with 37 additions and 0 deletions
|
|
@ -248,6 +248,7 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled
|
|||
pa_bool_t work_done = FALSE;
|
||||
pa_usec_t max_sleep_usec = 0, process_usec = 0;
|
||||
size_t left_to_record;
|
||||
unsigned j = 0;
|
||||
|
||||
pa_assert(u);
|
||||
pa_source_assert_ref(u->source);
|
||||
|
|
@ -303,6 +304,14 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled
|
|||
break;
|
||||
}
|
||||
|
||||
if (++j > 10) {
|
||||
#ifdef DEBUG_TIMING
|
||||
pa_log_debug("Not filling up, because already too many iterations.");
|
||||
#endif
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
polled = FALSE;
|
||||
|
||||
#ifdef DEBUG_TIMING
|
||||
|
|
@ -381,6 +390,7 @@ static int unix_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled
|
|||
int work_done = FALSE;
|
||||
pa_usec_t max_sleep_usec = 0, process_usec = 0;
|
||||
size_t left_to_record;
|
||||
unsigned j = 0;
|
||||
|
||||
pa_assert(u);
|
||||
pa_source_assert_ref(u->source);
|
||||
|
|
@ -424,6 +434,14 @@ static int unix_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled
|
|||
break;
|
||||
}
|
||||
|
||||
if (++j > 10) {
|
||||
#ifdef DEBUG_TIMING
|
||||
pa_log_debug("Not filling up, because already too many iterations.");
|
||||
#endif
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
polled = FALSE;
|
||||
|
||||
for (;;) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue