aac audio format handler: fix end of file timeout
[paraslash.git] / send.h
diff --git a/send.h b/send.h
index 75c13731bb1af9223a0a32fdc8c85792f04f3d50..f7198ed7df94f5b3c4491f15656a6f4649fea5b4 100644 (file)
--- a/send.h
+++ b/send.h
@@ -45,7 +45,7 @@ struct sender {
  * command. Of course, \a buf is a pointer to the chunk of data which
  * should be sent, and \a len is the length of this buffer.
 */
-       void (*send)(struct audio_format *af, long unsigned current_chunk,
+       void (*send)(struct audio_format_handler *af, long unsigned current_chunk,
                long unsigned chunks_sent, const char *buf, size_t len);
 /** add file descriptors to fd_sets
  *
@@ -58,7 +58,7 @@ struct sender {
  *
  * \sa select(2)
 */
-       void (*pre_select)(struct audio_format *af, int *max_fileno, fd_set *rfds,
+       void (*pre_select)(struct audio_format_handler *af, int *max_fileno, fd_set *rfds,
                fd_set *wfds);
 /**
  * handle the file descriptors which are ready for I/O
@@ -67,7 +67,7 @@ struct sender {
  * set, this is the hook to check the result and do any I/O on those descriptors
  * which are ready for reading/writing.
  */
-       void (*post_select)(struct audio_format *af, fd_set *rfds, fd_set *wfds);
+       void (*post_select)(struct audio_format_handler *af, fd_set *rfds, fd_set *wfds);
 /**
  * terminate all connected clients
  *
@@ -85,9 +85,16 @@ struct sender {
        int (*client_cmds[NUM_SENDER_CMDS])(struct sender_command_data*);
 };
 
+/**
+ * check a file descriptor for writability
+ *
+ * \param fd the file desctiptor
+ *
+ * \return positive if fd is ready for writing, zero if it isn't, negative if
+ * an error occured.
+ */
 
-
-static inline int _write_ok(int fd)
+static inline int write_ok(int fd)
 {
        struct timeval tv = {0, 0};
        fd_set wfds;
@@ -98,8 +105,5 @@ again:
        ret = select(fd + 1, NULL, &wfds, NULL, &tv);
        if (ret < 0 && errno == EINTR)
                goto again;
-       if (ret < 0)
-               ret = 0;
        return ret;
 }
-