mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-17 08:56:49 -05: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;
|
current_time = state->next_time;
|
||||||
|
|
||||||
if (SPA_UNLIKELY(get_status(state, current_time, &delay, &target) < 0))
|
if (SPA_UNLIKELY(get_status(state, current_time, &delay, &target) < 0)) {
|
||||||
return;
|
spa_log_error(state->log, "get_status error");
|
||||||
|
state->next_time += state->threshold * 1e9 / state->rate;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef FASTPATH
|
#ifndef FASTPATH
|
||||||
if (SPA_UNLIKELY(spa_log_level_enabled(state->log, SPA_LOG_LEVEL_TRACE))) {
|
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
|
else
|
||||||
handle_capture(state, current_time, delay, target);
|
handle_capture(state, current_time, delay, target);
|
||||||
|
|
||||||
|
done:
|
||||||
set_timeout(state, state->next_time);
|
set_timeout(state, state->next_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue