]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - vss.c
Makefile.in: Remove unused PICDIR.
[paraslash.git] / vss.c
diff --git a/vss.c b/vss.c
index 3d54f16cc0e6911f26ed9500832540f0b164a273..93ee76d7377e69a4a84223459d301f694e20da48 100644 (file)
--- a/vss.c
+++ b/vss.c
@@ -24,7 +24,6 @@
 #include "server.h"
 #include "net.h"
 #include "server.cmdline.h"
-#include "afs_common.h"
 #include "vss.h"
 #include "send.h"
 #include "ipc.h"
@@ -38,10 +37,8 @@ static struct timeval eof_barrier;
 static struct timeval autoplay_barrier;
 
 extern struct misc_meta_data *mmd;
-extern struct audio_file_selector selectors[];
 extern struct sender senders[];
 
-static int audio_file;
 static char *map;
 
 /**
@@ -103,7 +100,6 @@ void vss_init(void)
                        conf.announce_time_arg : 300,
                autoplay_delay = conf.autoplay_delay_arg > 0?
                        conf.autoplay_delay_arg : 0;
-       afh_init();
        ms2tv(announce_time, &announce_tv);
        PARA_INFO_LOG("announce timeval: %lums\n", tv2ms(&announce_tv));
        for (i = 0; senders[i].name; i++) {
@@ -196,7 +192,6 @@ static void vss_eof(void)
        tv_add(&mmd->afi.eof_tv, &now, &eof_barrier);
        munmap(map, mmd->size);
        map = NULL;
-       close(audio_file);
        mmd->audio_format = -1;
        mmd->chunks_sent = 0;
        mmd->offset = 0;
@@ -207,10 +202,6 @@ static void vss_eof(void)
                status_item_list[SI_AUDIO_INFO2], status_item_list[SI_AUDIO_INFO3]);
        strcpy(mmd->afi.info_string, tmp);
        free(tmp);
-       tmp  = make_message("%s:\n%s:\n%s:\n", status_item_list[SI_DBINFO1],
-               status_item_list[SI_DBINFO2], status_item_list[SI_DBINFO3]);
-       strcpy(mmd->selector_info, tmp);
-       free(tmp);
        mmd->filename[0] = '\0';
        mmd->size = 0;
        mmd->events++;
@@ -392,6 +383,7 @@ static void recv_afs_result(void)
                mmd->afd.afhi.chunks_total);
        ret = fstat(passed_fd, &statbuf);
        if (ret < 0) {
+               PARA_ERROR_LOG("fstat error:\n");
                ret = -ERRNO_TO_PARA_ERROR(errno);
                goto err;
        }
@@ -399,6 +391,7 @@ static void recv_afs_result(void)
        mmd->mtime = statbuf.st_mtime;
        map = para_mmap(mmd->size, PROT_READ, MAP_PRIVATE,
                passed_fd, 0);
+       close(passed_fd);
        strcpy(mmd->filename, mmd->afd.path); /* FIXME: check length */
        mmd->afi.header_len = 0; /* default: no header */
        mmd->audio_format = mmd->afd.afsi.audio_format_id;