X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=ao_write.c;h=41e609b70ab089acc384fb48c4fc40c58657c711;hb=08471ab23c0abdf0ddd7ff836a15bd81fbce7520;hp=447dea84c00a468330fe8229bfd70b74292264bd;hpb=c75c35b176cdacf157d27617e954961c88f33975;p=paraslash.git diff --git a/ao_write.c b/ao_write.c index 447dea84..41e609b7 100644 --- a/ao_write.c +++ b/ao_write.c @@ -42,7 +42,7 @@ static void aow_close(struct writer_node *wn) ao_shutdown(); } -static void aow_pre_select(struct sched *s, void *context) +static void aow_pre_monitor(struct sched *s, void *context) { struct writer_node *wn = context; struct private_aow_data *pawd = wn->private_data; @@ -342,7 +342,7 @@ fail: return -E_AO_PTHREAD; } -static int aow_post_select(__a_unused struct sched *s, void *context) +static int aow_post_monitor(__a_unused struct sched *s, void *context) { struct writer_node *wn = context; struct private_aow_data *pawd = wn->private_data; @@ -357,9 +357,15 @@ static int aow_post_select(__a_unused struct sched *s, void *context) goto remove_btrn; if (ret == 0) return 0; - get_btr_sample_rate(wn->btrn, &rate); - get_btr_channels(wn->btrn, &ch); - get_btr_sample_format(wn->btrn, &format); + ret = get_btr_sample_rate(wn->btrn, &rate); + if (ret < 0) + goto remove_btrn; + ret = get_btr_channels(wn->btrn, &ch); + if (ret < 0) + goto remove_btrn; + ret = get_btr_sample_format(wn->btrn, &format); + if (ret < 0) + goto remove_btrn; ret = aow_init(wn, rate, ch, format); if (ret < 0) goto remove_btrn; @@ -415,7 +421,7 @@ out: struct writer lsg_write_cmd_com_ao_user_data = { .close = aow_close, - .pre_select = aow_pre_select, - .post_select = aow_post_select, + .pre_monitor = aow_pre_monitor, + .post_monitor = aow_post_monitor, };