mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: make sure we always trigger a timeout
If we get an error from get_status() make sure program the timer for one period or else we would just end up with silence.
This commit is contained in:
parent
dc76ab2291
commit
8b899dbc55
1 changed files with 6 additions and 2 deletions
|
|
@ -2320,8 +2320,11 @@ static void alsa_on_timeout_event(struct spa_source *source)
|
|||
|
||||
current_time = state->next_time;
|
||||
|
||||
if (SPA_UNLIKELY(get_status(state, current_time, &delay, &target) < 0))
|
||||
return;
|
||||
if (SPA_UNLIKELY(get_status(state, current_time, &delay, &target) < 0)) {
|
||||
spa_log_error(state->log, "get_status error");
|
||||
state->next_time += state->threshold * 1e9 / state->rate;
|
||||
goto done;
|
||||
}
|
||||
|
||||
#ifndef FASTPATH
|
||||
if (SPA_UNLIKELY(spa_log_level_enabled(state->log, SPA_LOG_LEVEL_TRACE))) {
|
||||
|
|
@ -2341,6 +2344,7 @@ static void alsa_on_timeout_event(struct spa_source *source)
|
|||
else
|
||||
handle_capture(state, current_time, delay, target);
|
||||
|
||||
done:
|
||||
set_timeout(state, state->next_time);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue