]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
fix audiod on/off/sb commands
authorAndre <maan@p133.(none)>
Tue, 30 May 2006 01:23:11 +0000 (03:23 +0200)
committerAndre <maan@p133.(none)>
Tue, 30 May 2006 01:23:11 +0000 (03:23 +0200)
Unregister all running tasks in all running slots. That's much
cleaner than using the dirty hack with rn->eof we had before.

audiod.c
write_common.c

index 0c8ee2875873ef5c86b392448d0c80e6ec6e4540..8f6f3560ee37cb6cbb927630bb583937d51693db 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -499,8 +499,22 @@ static void kill_all_decoders(void)
 
        FOR_EACH_SLOT(i) {
                struct slot_info *s = &slot[i];
-               if (s->receiver_node)
+               if (s->wng && !s->wng->eof) {
+                       PARA_INFO_LOG("unregistering writer node group in slot %d\n",
+                               i);
+                       wng_unregister(s->wng);
+                       s->wng->eof = 1;
+               }
+               if (s->fc && !s->fc->eof) {
+                       PARA_INFO_LOG("unregistering filter chain in slot %d\n", i);
+                       unregister_task(&s->fc->task);
+                       s->fc->eof = 1;
+               }
+               if (s->receiver_node && !s->receiver_node->eof) {
+                       PARA_INFO_LOG("unregistering receiver_node in slot %d\n", i);
+                       unregister_task(&s->receiver_node->task);
                        s->receiver_node->eof = 1;
+               }
        }
 }
 
@@ -670,10 +684,6 @@ static void wng_event_handler(struct task *t)
                struct slot_info *s = &slot[i];
                if (s->wng != wng)
                        continue;
-//             if (s->fc)
-//                     s->fc->eof = 1;
-//             if (s->receiver_node)
-//                     s->receiver_node->eof = 1;
                PARA_INFO_LOG("slot %d: %s\n", i, PARA_STRERROR(-t->ret));
        }
 }
index 50784cec6b8b7815c6969eb85b8088e35dd83dd1..dda60168276e9695b32e1e843b0dd00b64381b7d 100644 (file)
@@ -90,6 +90,7 @@ void wng_unregister(struct writer_node_group *g)
                unregister_task(&wn->task);
        }
        unregister_task(&g->task);
+       g->eof = 1;
 }
 
 void wng_close(struct writer_node_group *g)