return 1;
}
+/**
+ * The main function of para_afh.
+ *
+ * \param argc Usual argument count.
+ * \param argv Usual argument vector.
+ *
+ * \return \p EXIT_FAILURE or \p EXIT_SUCCESS.
+ */
int main(int argc, char **argv)
{
int ret, audio_format_num, fd;
/** Structure passed to the \p print_blob function. */
struct lsblob_action_data {
- /* The flags given at the command line. */
+ /** The flags given at the command line. */
uint32_t flags;
/** Message buffer. */
struct para_buffer pb;
/** Describes one running instance of a chain of filters */
struct filter_chain {
+ /** The length of the filter chain. */
unsigned int num_filters;
/**
* The number of channels of the current stream.
* Used for scoring and to determine whether a file is admissible.
*/
struct mood_method {
- /* The name of the method. */
+ /** The name of the method. */
const char *name;
/** Pointer to the mood parser. */
mood_parser *parser;
/** Describes the current status of one paraslash sender. */
struct sender_status {
- /* The file descriptor of the socket this sender is listening on. */
+ /** The file descriptor of the socket this sender is listening on. */
int listen_fd;
/** The TCP/DCCP port used by this sender. */
int port;
* Close the file descriptor given by \a sc, remove it from the close-on-fork
* list, destroy the chunk queue of this client, delete the client from the
* list of connected clients and free the sender_client struct.
+ *
+ * \sa shutdown_clients().
*/
void shutdown_client(struct sender_client *sc, struct sender_status *ss)
{
ss->num_clients--;
}
+/**
+ * Shut down all clients connected to a paraslash sender.
+ *
+ * \param ss The sender whose clients are to be shut down.
+ *
+ * This just loops over all connected clients and calls shutdown_client()
+ * for each client.
+ */
void shutdown_clients(struct sender_status *ss)
{
struct sender_client *sc, *tmp;
return ret;
}
+/**
+ * Compute when to send a chunk of an audio file.
+ *
+ * \param chunk_num The number of the chunk.
+ * \param chunk_tv The duration of one chunk.
+ * \param stream_start When the first chunk was sent.
+ * \param result The time when to send chunk number \a chunk_num.
+ *
+ * This function computes stream_start + chunk_num * chunk_time.
+ */
void compute_chunk_time(long unsigned chunk_num,
struct timeval *chunk_tv, struct timeval *stream_start,
struct timeval *result)
unsigned channels;
/** Sample rate specified in wav header given by \a buf. */
unsigned samplerate;
+ /** The task structure used by the scheduler. */
struct task task;
};