Add some more FEC source code documentation.
[paraslash.git] / mp3_afh.c
index ebb6bf5291281d2fa9343fea21544617c79bfcdc..932a772101e234165ca96aff85a9f684b07597cc 100644 (file)
--- a/mp3_afh.c
+++ b/mp3_afh.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2003-2009 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -71,21 +71,6 @@ static const int mp3info_bitrate[2][3][14] = {
 static const int frame_size_index[] = {24000, 72000, 72000};
 static const char *mode_text[] = {"stereo", "joint stereo", "dual channel", "mono", "invalid"};
 
-static char *make_taginfo(char *title, char *artist, char *album, char *year,
-               char *comment)
-{
-       return make_message("%s: %s, by %s\n" /* taginfo1 */
-               "%s: A: %s, Y: %s, C: %s\n", /* taginfo 2*/
-               status_item_list[SI_TAGINFO1],
-               (title && *title)? title : "(title tag not set)",
-               (artist && *artist)? artist : "(artist tag not set)",
-               status_item_list[SI_TAGINFO2],
-               (album && *album)?  album : "(album tag not set)",
-               (year && *year)? year : "????",
-               (comment && *comment)? comment : "(comment tag not set)"
-       );
-}
-
 #ifdef HAVE_LIBID3TAG
 
 #include <id3tag.h>
@@ -97,7 +82,7 @@ static char *get_latin1(id3_ucs4_t const *string)
        return (char *)id3_ucs4_latin1duplicate(string);
 }
 
-char *get_stringlist(union id3_field *field)
+static char *get_stringlist(union id3_field *field)
 {
        unsigned int k, nstrings = id3_field_getnstrings(field);
        char *result = NULL;
@@ -295,7 +280,7 @@ static int frame_length(struct mp3header *header)
 
 static int compare_headers(struct mp3header *h1,struct mp3header *h2)
 {
-       if ((*(uint*)h1) == (*(uint*)h2))
+       if ((*(unsigned int*)h1) == (*(unsigned int*)h2))
                return 1;
        if ((h1->version == h2->version) &&
                        (h1->layer == h2->layer) &&
@@ -418,7 +403,7 @@ static int mp3_read_info(unsigned char *map, size_t numbytes, int fd,
        char *taginfo;
 
        afhi->chunks_total = 0;
-       afhi->chunk_table = para_malloc(chunk_table_size * sizeof(size_t));
+       afhi->chunk_table = para_malloc(chunk_table_size * sizeof(uint32_t));
        taginfo = mp3_get_id3(map, numbytes, fd);
        while (1) {
                unsigned long freq, br, fl;
@@ -448,7 +433,7 @@ static int mp3_read_info(unsigned char *map, size_t numbytes, int fd,
                if (afhi->chunks_total >= chunk_table_size) {
                        chunk_table_size *= 2;
                        afhi->chunk_table = para_realloc(afhi->chunk_table,
-                               chunk_table_size * sizeof(size_t));
+                               chunk_table_size * sizeof(uint32_t));
                }
                afhi->chunk_table[afhi->chunks_total] = fpos;
 //             if (afhi->chunks_total < 10 || !(afhi->chunks_total % 1000))