mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: remove useless code
The resync check can be done in check_position_config.
This commit is contained in:
parent
4246961070
commit
798228a906
2 changed files with 2 additions and 19 deletions
|
|
@ -1861,6 +1861,7 @@ static inline void check_position_config(struct state *state)
|
|||
state->rate_denom = state->position->clock.rate.denom;
|
||||
state->threshold = (state->duration * state->rate + state->rate_denom-1) / state->rate_denom;
|
||||
state->resample = ((uint32_t)state->rate != state->rate_denom) || state->matching;
|
||||
state->alsa_sync = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2107,23 +2108,7 @@ int spa_alsa_read(struct state *state)
|
|||
snd_pcm_sframes_t commitres;
|
||||
int res = 0;
|
||||
|
||||
if (state->position) {
|
||||
check_position_config(state);
|
||||
|
||||
if (!state->following) {
|
||||
uint64_t position;
|
||||
|
||||
position = state->position->clock.position;
|
||||
if (state->last_position && state->last_position + state->last_duration != position) {
|
||||
state->alsa_sync = true;
|
||||
spa_log_info(state->log, "%s: discont, resync %"PRIu64" %"PRIu64" %d",
|
||||
state->props.device, state->last_position,
|
||||
position, state->last_duration);
|
||||
}
|
||||
state->last_position = position;
|
||||
state->last_duration = state->duration;
|
||||
}
|
||||
}
|
||||
check_position_config(state);
|
||||
|
||||
max_read = state->buffer_frames;
|
||||
|
||||
|
|
|
|||
|
|
@ -189,8 +189,6 @@ struct state {
|
|||
uint32_t start_delay;
|
||||
|
||||
uint32_t duration;
|
||||
uint32_t last_duration;
|
||||
uint64_t last_position;
|
||||
unsigned int alsa_started:1;
|
||||
unsigned int alsa_sync:1;
|
||||
unsigned int alsa_recovering:1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue