X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=ogg_afh_common.c;h=734fd58680b1f944f6adf51c76aebb19d1b5b5c7;hp=adab7f481fbb0e7873c1d1e1ac4968834bd81fe3;hb=173091699461dc4c08cb34bdb692cf001d8b578f;hpb=21c6e0b09b42e61e72b741bd726856ab0bcd1d64 diff --git a/ogg_afh_common.c b/ogg_afh_common.c index adab7f48..734fd586 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) @@ -182,6 +181,7 @@ int ogg_get_file_info(char *map, size_t numbytes, struct afh_info *afhi, } } afhi->chunks_total = j; + set_max_chunk_size(afhi); set_chunk_tv(frames_per_chunk, afhi->frequency, &afhi->chunk_tv); ret = 0; out: