X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=vss.c;h=e6cf59676fe4699b85501b5334de8c99b090a4f1;hp=3ef850c7ccb8bfad203ce659b320dd94ada2d8e9;hb=f07fded9f5645a7ac89e63baf50b895cd3a4a140;hpb=0e8849e41ffaffdc94231568ff0a0a061500e341 diff --git a/vss.c b/vss.c index 3ef850c7..e6cf5967 100644 --- a/vss.c +++ b/vss.c @@ -11,11 +11,14 @@ * senders. */ +#include /* mmap */ +#include /* gettimeofday */ +#include +#include + #include "para.h" #include "afh.h" #include "server.h" -#include /* mmap */ -#include /* 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)"; } @@ -173,7 +178,7 @@ void vss_init(void) PARA_DEBUG_LOG("supported audio formats: %s\n", SUPPORTED_AUDIO_FORMATS); - for (i = 0; afl[i].name; i++) { + FOR_EACH_AUDIO_FORMAT(i) { PARA_NOTICE_LOG("initializing %s handler\n", afl[i].name); afl[i].init(&afl[i]); @@ -278,6 +283,7 @@ int compute_afhi(const char *path, char *data, size_t size, ret = afl[i].get_file_info(data, size, afhi); if (ret >= 0) return i; + PARA_WARNING_LOG("%s\n", PARA_STRERROR(-ret)); } return -E_AUDIO_FORMAT; }