/* count ogg pages and get duration of the file */
for (i = 0; ogg_sync_pageseek(&oss, &op) > 0; i++) {
int this_pageno = ogg_page_pageno(&op);
-
- granule = ogg_page_granulepos(&op);
+ int64_t this_granule = ogg_page_granulepos(&op);
+ if (this_granule >= 0)
+ granule = this_granule;
if (i > 0 && this_pageno != prev_pageno + 1) /* hole */
granule_skip += granule - prev_granule;
prev_pageno = this_pageno;
PARA_INFO_LOG("%" PRIu32 " seconds, %d frames/chunk\n",
afhi->seconds_total, frames_per_chunk);
ct_size = 250;
- afhi->chunk_table = para_malloc(ct_size * sizeof(uint32_t));
+ afhi->chunk_table = arr_alloc(ct_size, sizeof(uint32_t));
afhi->chunk_table[0] = 0;
afhi->chunk_table[1] = afhi->header_len;
oss.returned = afhi->header_len;
j++;
if (j >= ct_size) {
ct_size *= 2;
- afhi->chunk_table = para_realloc(
+ afhi->chunk_table = arr_realloc(
afhi->chunk_table,
- ct_size * sizeof(uint32_t));
+ ct_size, sizeof(uint32_t));
}
afhi->chunk_table[j] = oss.returned;
}
*/
struct oac_custom_header *oac_custom_header_new(void)
{
- return para_calloc(sizeof(struct oac_custom_header));
+ return zalloc(sizeof(struct oac_custom_header));
}
/**