#define CHUNK_SIZE 32768
static double chunk_time = 0.25;
-FILE *audio_file;
-
static size_t cb_read(void *buf, size_t size, size_t nmemb, void *datasource)
{
FILE *f = datasource;
return 0;
}
-long cb_tell(void *datasource)
+static long cb_tell(void *datasource)
{
FILE *f = datasource;
return ftell(f);
}
-int ogg_open_callbacks(void *datasource, OggVorbis_File *vf, ov_callbacks c)
+static int ogg_open_callbacks(void *datasource, OggVorbis_File *vf, ov_callbacks c)
{
int ret = ov_open_callbacks(datasource, vf,
NULL, /* no initial buffer */
max_chunk_len = PARA_MAX(max_chunk_len, diff);
min = (i == 1)? diff : PARA_MIN(min, diff);
afi->chunk_table[i] = pos;
- if (i < 11 || !((i - 1) % 1000)|| i > num - 11)
- PARA_DEBUG_LOG("chunk #%d: %g secs, pos: %zd, "
- "size: %zd\n", i - 1,
- i * chunk_time, pos, pos - old_pos);
+// if (i < 11 || !((i - 1) % 1000)|| i > num - 11)
+// PARA_DEBUG_LOG("chunk #%d: %g secs, pos: %zd, "
+// "size: %zd\n", i - 1,
+// i * chunk_time, pos, pos - old_pos);
old_pos = pos;
}
num_chunks = i - 1;
return num_chunks;
}
-static void ogg_close_audio_file(void)
-{
- fclose(audio_file);
-}
-
/*
* Init oggvorbis file and write some tech data to given pointers.
*/
vi_sampling_rate / 1000, vi->channels, vi_bitrate / 1000
);
rewind(file);
- audio_file = file;
afi->chunk_tv.tv_sec = 0;
afi->chunk_tv.tv_usec = 250 * 1000;
tv_scale(3, &afi->chunk_tv, &afi->eof_tv);
/**
* the init function of the ogg vorbis audio format handler
*
- * \param p pointer to the struct to initialize
+ * \param afh pointer to the struct to initialize
*/
void ogg_init(struct audio_format_handler *afh)
{
afh->get_file_info = ogg_get_file_info,
- afh->close_audio_file = ogg_close_audio_file;
afh->suffixes = ogg_suffixes;
}