fix serious typo
[paraslash.git] / write.c
diff --git a/write.c b/write.c
index 538651d662e1ad917b36525e91ed5a38283b231a..43c0690b9bf87f7a057b80ad79ee8ac73a667a51 100644 (file)
--- a/write.c
+++ b/write.c
@@ -139,7 +139,7 @@ static int pcm_write(struct writer_node_group *wng, size_t loaded)
                * wng->max_chunk_bytes;
        audiobuf = para_realloc(audiobuf, bufsize);
        prebuf_size = conf.prebuffer_arg * bufsize / 100;
-       bytes_to_load =  PARA_MAX(prebuf_size, wng->max_chunk_bytes);
+       bytes_to_load =  PARA_MIN(prebuf_size, wng->max_chunk_bytes);
        ret = read_stdin(audiobuf, bytes_to_load, &loaded);
        if (ret <= 0 || loaded < bytes_to_load) {
                if (ret >= 0)
@@ -227,7 +227,7 @@ out:
  */
 static size_t check_wave(void)
 {
-       unsigned char *a = audiobuf;
+       unsigned char *a = (unsigned char*)audiobuf;
        if (a[0] != 'R' || a[1] != 'I' || a[2] != 'F' || a[3] != 'F')
                return WAV_HEADER_LEN;
        conf.channels_arg = (unsigned) a[22];