X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=ogg_afh_common.c;h=6e5a89347e383340f943e591254f64f05cc6f358;hp=e49b803b4e7a0e6492161d7be5c2b2fa21a16a09;hb=3f696a82bbb79cb07bfdb8e510bb4f3515570cec;hpb=75695bba841fc43094ebc669418187080cea00e6 diff --git a/ogg_afh_common.c b/ogg_afh_common.c index e49b803b..6e5a8934 100644 --- a/ogg_afh_common.c +++ b/ogg_afh_common.c @@ -127,19 +127,18 @@ int ogg_get_file_info(char *map, size_t numbytes, struct afh_info *afhi, { ogg_sync_state oss; ogg_page op; - long len = numbytes; char *buf; int ret, i, j, frames_per_chunk, ct_size; long long unsigned num_frames = 0; ogg_sync_init(&oss); ret = -E_OGG_SYNC; - buf = ogg_sync_buffer(&oss, len); + buf = ogg_sync_buffer(&oss, numbytes); if (!buf) goto out; - memcpy(buf, map, len); + memcpy(buf, map, numbytes); ret = -E_OGG_SYNC; - if (ogg_sync_wrote(&oss, len) < 0) + if (ogg_sync_wrote(&oss, numbytes) < 0) goto out; ret = process_ogg_packets(&oss, afhi, ci); if (ret < 0) @@ -193,7 +192,7 @@ static int write_ogg_page(int fd, const ogg_page *op) { int ret; - PARA_DEBUG_LOG("header/body: %lu/%lu\n", op->header_len, op->body_len); + PARA_DEBUG_LOG("header/body: %li/%li\n", op->header_len, op->body_len); ret = xwrite(fd, (const char *)op->header, op->header_len); if (ret < 0) return ret; @@ -288,7 +287,7 @@ int ogg_rewrite_tags(const char *map, size_t map_sz, int fd, goto out; continue; } - PARA_DEBUG_LOG("packet: bytes: %d, granule: %d, packetno: %u\n", + PARA_DEBUG_LOG("packet: bytes: %d, granule: %d, packetno: %d\n", (int)packet.bytes, (int)packet.granulepos, (int)packet.packetno); /* ignore meta data packet which we replaced */ @@ -309,7 +308,7 @@ int ogg_rewrite_tags(const char *map, size_t map_sz, int fd, #endif if (ret <= 0) break; - PARA_DEBUG_LOG("writing page (%lu bytes)\n", + PARA_DEBUG_LOG("writing page (%li bytes)\n", op.header_len + op.body_len); ret = write_ogg_page(fd, &op); if (ret < 0)