From 7edbace7e8190121765a0517053c00b0106a1bcc Mon Sep 17 00:00:00 2001 From: Andre Date: Sun, 4 Jun 2006 21:44:17 +0200 Subject: [PATCH] some audiod fixes comment out code for unregistering the receiver node from close_receiver. kill all decoders if !playing try to close slots in audiod_post_select() rather than in pre_select(). This should fix BADFD error from select(). --- audiod.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/audiod.c b/audiod.c index f08be183..29ceda53 100644 --- a/audiod.c +++ b/audiod.c @@ -506,8 +506,8 @@ static void close_receiver(int slot_num) a = &afi[s->format]; PARA_NOTICE_LOG("closing %s receiver in slot %d (eof = %d)\n", audio_formats[s->format] , slot_num, s->receiver_node->eof); - if (!s->receiver_node->eof) - unregister_task(&s->receiver_node->task); +// if (!s->receiver_node->eof) +// unregister_task(&s->receiver_node->task); a->receiver->close(s->receiver_node); free(s->receiver_node); s->receiver_node = NULL; @@ -944,7 +944,7 @@ static void audiod_pre_select(struct sched *s, __a_unused struct task *t) t->ret = 1; now = &s->now; - if (audiod_status != AUDIOD_ON) + if (audiod_status != AUDIOD_ON || !playing) kill_all_decoders(); else if (playing) open_current_receiver(); @@ -952,7 +952,6 @@ static void audiod_pre_select(struct sched *s, __a_unused struct task *t) struct slot_info *s = &slot[i]; struct audio_format_info *a; - try_to_close_slot(i); if (s->format < 0) continue; a = &afi[s->format]; @@ -974,9 +973,13 @@ static void audiod_pre_select(struct sched *s, __a_unused struct task *t) static void audiod_post_select(struct sched *s, __a_unused struct task *t) { - /* only save away the current time for other users */ + int i; + + /* save away the current time for other users */ now = &s->now; t->ret = 1; + FOR_EACH_SLOT(i) + try_to_close_slot(i); } static void init_audiod_task(struct task *t) -- 2.39.5