/* Taken from decoder_example.c of libvorbis-1.2.3. */
static int process_packets_2_and_3(ogg_sync_state *oss,
ogg_stream_state *stream, struct afh_info *afhi,
- struct ogg_afh_callback_info *ci)
+ struct oac_callback_info *ci)
{
ogg_page page;
ogg_packet packet;
}
static int process_ogg_packets(ogg_sync_state *oss, struct afh_info *afhi,
- struct ogg_afh_callback_info *ci)
+ struct oac_callback_info *ci)
{
ogg_packet packet;
ogg_stream_state stream;
*
* \return Standard.
*/
-int ogg_get_file_info(char *map, size_t numbytes, struct afh_info *afhi,
- struct ogg_afh_callback_info *ci)
+int oac_get_file_info(char *map, size_t numbytes, struct afh_info *afhi,
+ struct oac_callback_info *ci)
{
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)
}
}
afhi->chunks_total = j;
+ set_max_chunk_size(afhi);
set_chunk_tv(frames_per_chunk, afhi->frequency, &afhi->chunk_tv);
ret = 0;
out:
{
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;
*
* \return Standard.
*/
-int ogg_rewrite_tags(const char *map, size_t map_sz, int fd,
+int oac_rewrite_tags(const char *map, size_t map_sz, int fd,
char *meta_packet, size_t meta_sz)
{
ogg_sync_state oss_in, oss_out;
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 */
#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)