return -E_ALSA_WRITE;
}
+static void alsa_close(struct writer_node *wn)
+{
+ struct private_alsa_write_data *pad = wn->private_data;
+ PARA_INFO_LOG("closing writer node %p\n", wn);
+
+ if (pad->handle) {
+ snd_pcm_drain(pad->handle);
+ snd_pcm_close(pad->handle);
+ snd_config_update_free_global();
+ }
+ free(pad);
+}
+
static void alsa_write_post_select_btr(__a_unused struct sched *s,
struct task *t)
{
ret = -E_ALSA_WRITE;
err:
assert(ret < 0);
+ alsa_close(wn);
btr_del_node(wn->btrn);
wn->btrn = NULL;
t->error = ret;
}
-static void alsa_close(struct writer_node *wn)
-{
- struct private_alsa_write_data *pad = wn->private_data;
- PARA_INFO_LOG("closing writer node %p\n", wn);
-
- if (pad->handle) {
- snd_pcm_drain(pad->handle);
- snd_pcm_close(pad->handle);
- snd_config_update_free_global();
- }
- free(pad);
-}
-
__malloc static void *alsa_parse_config(const char *options)
{
int ret;