]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - afh_recv.c
string: Rename para_malloc() -> alloc().
[paraslash.git] / afh_recv.c
index 4f8ff4974f018ef92e5055ac7a28bf337e3aa301..e7f85a1bd5a6dce0c8c256b22e52e2c1c9bf9ece 100644 (file)
@@ -174,6 +174,7 @@ static int afh_recv_post_select(__a_unused struct sched *s, void *context)
        char *buf;
        const char *start;
        size_t size;
+       uint32_t len;
        struct timeval chunk_time;
        unsigned j_given = RECV_CMD_OPT_GIVEN(AFH, JUST_IN_TIME, lpr);
        unsigned H_given = RECV_CMD_OPT_GIVEN(AFH, NO_HEADER, lpr);
@@ -187,7 +188,7 @@ static int afh_recv_post_select(__a_unused struct sched *s, void *context)
                        pard->map_size, &header, &size);
                if (size > 0) {
                        PARA_INFO_LOG("writing header (%zu bytes)\n", size);
-                       buf = para_malloc(size);
+                       buf = alloc(size);
                        memcpy(buf, header, size);
                        btr_add_output(buf, size, btrn);
                        afh_free_header(header, pard->audio_format_num);
@@ -197,12 +198,12 @@ static int afh_recv_post_select(__a_unused struct sched *s, void *context)
                long unsigned n;
                for (n = pard->first_chunk; n < pard->last_chunk; n++) {
                        ret = afh_get_chunk(n, afhi, pard->audio_format_num,
-                               pard->map, pard->map_size, &start, &size,
+                               pard->map, pard->map_size, &start, &len,
                                &pard->afh_context);
                        if (ret < 0)
                                goto out;
-                       PARA_DEBUG_LOG("adding %zu bytes\n", size);
-                       btr_add_output_dont_free(start, size, btrn);
+                       PARA_DEBUG_LOG("adding %u bytes\n", len);
+                       btr_add_output_dont_free(start, len, btrn);
                }
                ret = -E_RECV_EOF;
                goto out;
@@ -218,12 +219,12 @@ static int afh_recv_post_select(__a_unused struct sched *s, void *context)
        }
        ret = afh_get_chunk(pard->current_chunk, afhi,
                pard->audio_format_num, pard->map,
-               pard->map_size, &start, &size,
+               pard->map_size, &start, &len,
                &pard->afh_context);
        if (ret < 0)
                goto out;
        PARA_DEBUG_LOG("adding chunk %u\n", pard->current_chunk);
-       btr_add_output_dont_free(start, size, btrn);
+       btr_add_output_dont_free(start, len, btrn);
        if (pard->current_chunk >= pard->last_chunk) {
                ret = -E_RECV_EOF;
                goto out;