alsa: set_timeout is only called when tsched is enabled.

We don't need to do an extra check.
This commit is contained in:
Wim Taymans 2023-09-14 17:16:44 +02:00
parent 4ffa7860bc
commit 3c5da11706

View file

@ -1850,10 +1850,6 @@ static int set_swparams(struct state *state)
static int set_timeout(struct state *state, uint64_t time)
{
struct itimerspec ts;
if (state->disable_tsched)
return 0;
ts.it_value.tv_sec = time / SPA_NSEC_PER_SEC;
ts.it_value.tv_nsec = time % SPA_NSEC_PER_SEC;
ts.it_interval.tv_sec = 0;
@ -2773,9 +2769,9 @@ static void alsa_wakeup_event(struct spa_source *source)
handle_capture(state, current_time, avail, delay, target);
done:
if (!state->disable_tsched &&
(state->next_time > current_time + SPA_NSEC_PER_SEC ||
current_time > state->next_time + SPA_NSEC_PER_SEC)) {
if (!state->disable_tsched) {
if (state->next_time > current_time + SPA_NSEC_PER_SEC ||
current_time > state->next_time + SPA_NSEC_PER_SEC) {
if ((suppressed = spa_ratelimit_test(&state->rate_limit, current_time)) >= 0) {
spa_log_error(state->log, "%s: impossible timeout %lu %lu %lu %"
PRIu64" %"PRIu64" %"PRIi64" %d %"PRIi64" (%d suppressed)",
@ -2787,6 +2783,7 @@ done:
}
set_timeout(state, state->next_time);
}
}
static void reset_buffers(struct state *this)
{