]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - vss.c
command.c: Document return value of handle_connect().
[paraslash.git] / vss.c
diff --git a/vss.c b/vss.c
index fbc35e1a71c8983a5045ff8e0b7bc300f1dfb0ab..0a1ac525abc8389ef6d7f1ed1817d9fbc0dd664a 100644 (file)
--- a/vss.c
+++ b/vss.c
@@ -1084,8 +1084,10 @@ static int vss_post_select(struct sched *s, void *context)
        struct vss_task *vsst = context;
 
        ret = task_get_notification(vsst->task);
-       if (ret < 0)
+       if (ret < 0) {
+               afh_free_header(vsst->header_buf, mmd->afd.audio_format_id);
                return ret;
+       }
        if (!vsst->map || vss_next() || vss_paused() || vss_repos()) {
                /* shut down senders and fec clients */
                struct fec_client *fc, *tmp;
@@ -1188,3 +1190,20 @@ void vss_init(int afs_socket, struct sched *s)
                .context = vsst,
        }, s);
 }
+
+/**
+ * Turn off the virtual streaming system.
+ *
+ * This is only executed on exit. It calls the ->shutdowwn method of all senders.
+ */
+void vss_shutdown(void)
+{
+       int i;
+
+       FOR_EACH_SENDER(i) {
+               if (!senders[i]->shutdown)
+                       continue;
+               PARA_NOTICE_LOG("shutting down %s sender\n", senders[i]->name);
+               senders[i]->shutdown();
+       }
+}