- buf = vsst->header_buf;
- for (i = 0; i < g->num_header_slices; i++) {
- if (buf + g->slice_bytes <= vsst->header_buf + vsst->header_len) {
- fc->src_data[i] = (const unsigned char *)buf;
- buf += g->slice_bytes;
- continue;
- }
- /*
- * Can not use vss->header_buf for this slice as it
- * goes beyond the buffer. This slice will not be fully
- * used.
- */
- uint32_t payload_size = vsst->header_buf
- + vsst->header_len - buf;
- memcpy(fc->extra_header_buf, buf, payload_size);
- if (payload_size < g->slice_bytes)
- memset(fc->extra_header_buf + payload_size, 0,
- g->slice_bytes - payload_size);
- fc->src_data[i] = fc->extra_header_buf;
- assert(i == g->num_header_slices - 1);
- }
-
- /* setup data slices */
- afh_get_chunk(g->first_chunk, &mmd->afd.afhi, vsst->map, &buf, &len);
- for (; i < g->num_header_slices + data_slices; i++) {
- if (buf + g->slice_bytes > vsst->map + mmd->size) {
- /*
- * Can not use the memory mapped audio file for this
- * slice as it goes beyond the map.
- */
- uint32_t payload_size = vsst->map + mmd->size - buf;
- memcpy(fc->extra_src_buf, buf, payload_size);
- if (payload_size < g->slice_bytes)
- memset(fc->extra_src_buf + payload_size, 0,
- g->slice_bytes - payload_size);
- fc->src_data[i] = fc->extra_src_buf;
- i++;