X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=write.c;h=7b95d6b37eb3865d475a3bda4f822ec3e9b60893;hp=64c08d8b9e1412e7ed88c234609bc68173283049;hb=192417698d9dab017ef6108fa6e9fd5ea1dc5633;hpb=471684761a2039bbc89aa1e3c33c62de6bef86cf diff --git a/write.c b/write.c index 64c08d8b..7b95d6b3 100644 --- a/write.c +++ b/write.c @@ -4,7 +4,10 @@ * Licensed under the GPL v2. For licencing details see COPYING. */ -/** \file write.c Paraslash's standalone wav/raw player */ +/** \file write.c Paraslash's standalone wav/raw player. */ + +#include +#include #include "para.h" #include "string.h" @@ -19,31 +22,27 @@ INIT_WRITE_ERRLISTS; -/** - * check if given buffer contains a valid wave header - */ +/** Check if given buffer contains a valid wave header. */ struct check_wav_task { - /** the buffer to check */ + /** The buffer to check. */ char *buf; - /** number of bytes loaded in \a buf */ + /** Number of bytes loaded in \a buf. */ size_t *loaded; - /** non-zero if end of file was reached */ + /** Non-zero if end of file was reached. */ int *eof; - /** number of channels specified in wav header given by \a buf */ + /** Number of channels specified in wav header given by \a buf. */ unsigned channels; - /** samplerate specified in wav header given by \a buf */ + /** Samplerate specified in wav header given by \a buf. */ unsigned samplerate; - /** the task structure for this task */ + /** The task structure for this task. */ struct task task; }; -/** - * delay writing until given time - */ +/** Delay writing until given time. */ struct initial_delay_task { - /** the time the first data should be written out */ + /** The time the first data should be written out. */ struct timeval start_time; - /** the task structure for this task */ + /** The task structure for this task. */ struct task task; }; @@ -53,11 +52,11 @@ static struct check_wav_task cwt; static struct initial_delay_task idt; static struct writer_node_group *wng; -/** length of a standard wav header */ +/** Length of a standard wav header. */ #define WAV_HEADER_LEN 44 /** - * test if audio buffer contains a valid wave header + * Test if audio buffer contains a valid wave header. * * \return If not, return -E_NO_WAV_HEADER, otherwise, return zero. If * there is less than WAV_HEADER_LEN bytes awailable, return one. @@ -202,10 +201,10 @@ static void cwt_event_handler(struct task *t) } /** - * para_write's main function + * Para_write's main function. * - * \param argc the usual argument counter - * \param argv the usual argument vector + * \param argc The usual argument counter. + * \param argv The usual argument vector. * * It registers the stdin task, the check_wav_task, the task for initial delay * and all tasks for actually writing out the stream.