#define CHUNK_SIZE 32768
static double chunk_time = 0.25;
-FILE *audio_file;
-static struct audio_format_handler *af;
-
static size_t cb_read(void *buf, size_t size, size_t nmemb, void *datasource)
{
FILE *f = datasource;
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 *p)
+void ogg_init(struct audio_format_handler *afh)
{
- af = p;
- af->get_file_info = ogg_get_file_info,
- af->close_audio_file = ogg_close_audio_file;
- af->suffixes = ogg_suffixes;
+ afh->get_file_info = ogg_get_file_info,
+ afh->suffixes = ogg_suffixes;
}