X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=ogg_afh.c;h=1df5fd6f68e2e17ce119324d24b371c0230005d8;hp=1034091358b51b300737fcd3ae5404ac0a5363fe;hb=22245300541fa7d6e92cdcd7bc4204fd2d73f799;hpb=3a624c04894f5b0fa4a1c0850307b33bf92c8e51 diff --git a/ogg_afh.c b/ogg_afh.c index 10340913..1df5fd6f 100644 --- a/ogg_afh.c +++ b/ogg_afh.c @@ -32,8 +32,6 @@ #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; @@ -53,13 +51,13 @@ static int cb_close(__a_unused void *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 */ @@ -201,10 +199,10 @@ static long unsigned ogg_compute_chunk_table(OggVorbis_File *of, 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; @@ -214,11 +212,6 @@ static long unsigned ogg_compute_chunk_table(OggVorbis_File *of, return num_chunks; } -static void ogg_close_audio_file(void) -{ - fclose(audio_file); -} - /* * Init oggvorbis file and write some tech data to given pointers. */ @@ -266,7 +259,6 @@ static int ogg_get_file_info(FILE *file, struct audio_format_info *afi) 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); @@ -283,11 +275,10 @@ static const char* ogg_suffixes[] = {"ogg", NULL}; /** * 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; }