]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - vss.c
Implement add -a (add all audio files).
[paraslash.git] / vss.c
diff --git a/vss.c b/vss.c
index 2de7a30c7bdc328cc82041135918a70da02c9578..5b7ed320aaaa38885f208dda80ad51d690999b2c 100644 (file)
--- a/vss.c
+++ b/vss.c
  * senders.
  */
 
+#include <sys/mman.h> /* mmap */
+#include <sys/time.h> /* gettimeofday */
+#include <sys/types.h>
+#include <dirent.h>
+
 #include "para.h"
 #include "afh.h"
 #include "server.h"
-#include <sys/mman.h> /* mmap */
-#include <sys/time.h> /* gettimeofday */
 #include "server.cmdline.h"
 #include "afs_common.h"
 #include "vss.h"
@@ -144,15 +147,17 @@ unsigned int vss_paused(void)
 }
 
 /**
- * get the name of the given audio format
+ * Get the name of the given audio format.
  *
- * \param i the audio format number
+ * \param i The audio format number.
  *
  * This returns a pointer to statically allocated memory so it
  * must not be freed by the caller.
  */
 const char *audio_format_name(int i)
 {
+       //PARA_NOTICE_LOG("array size: %u¸ requested: %d\n", ARRAY_SIZE(afl), i);
+       assert(i < 0 || i < ARRAY_SIZE(afl) - 1);
        return i >= 0?  afl[i].name : "(none)";
 }
 
@@ -228,7 +233,7 @@ int guess_audio_format(const char *name)
                        return i;
                }
        }
-       return -1;
+       return -E_BAD_AUDIO_FILE_SUFFIX;
 }
 
 static int get_audio_format(int omit)