alsa: refactor a bit

Make spa_alsa_close() do spa_alsa_pause() first and also clear the
format.
This commit is contained in:
Wim Taymans 2021-11-23 12:20:27 +01:00
parent 13923416e0
commit 25bfc9c63d
3 changed files with 9 additions and 11 deletions

View file

@ -587,11 +587,8 @@ static int port_set_format(void *object,
return 0;
spa_log_debug(this->log, "clear format");
this->card->format_ref--;
spa_alsa_pause(this);
clear_buffers(this);
spa_alsa_close(this);
this->have_format = false;
clear_buffers(this);
} else {
struct spa_audio_info info = { 0 };
@ -609,7 +606,6 @@ static int port_set_format(void *object,
return err;
this->current_format = info;
this->have_format = true;
}
this->info.change_mask |= SPA_NODE_CHANGE_MASK_PROPS;