]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - ogg_afh.c
vss.c: rename get_song() to vss_get_audio_file()
[paraslash.git] / ogg_afh.c
index f972c630ee837953fe6d56c11b332c1124e131d3..1df5fd6f68e2e17ce119324d24b371c0230005d8 100644 (file)
--- a/ogg_afh.c
+++ b/ogg_afh.c
@@ -32,9 +32,6 @@
 #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;
@@ -54,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 */
@@ -202,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;
@@ -215,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.
  */
@@ -267,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);
@@ -284,12 +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 *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;
 }