Kill afhi->header_offset.
[paraslash.git] / afh.c
diff --git a/afh.c b/afh.c
index b38dfbba056a321493226663849beab0d50ce273..b5fb65fc418a6e4a3febef87cdce6d630b81cfb3 100644 (file)
--- a/afh.c
+++ b/afh.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008-2010 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2008-2011 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -76,7 +76,7 @@ static void print_chunk_table(struct afh_info *afhi)
                from = tv2ms(&tv);
                tv_scale(i, &afhi->chunk_tv, &tv);
                to = tv2ms(&tv);
-               printf("%d [%lu.%03lu - %lu.%03lu] %u - %u (%u)\n", i,
+               printf("%d [%lu.%03lu - %lu.%03lu] %u - %u (%u)\n", i - 1,
                        from / 1000, from % 1000, to / 1000, to % 1000,
                        afhi->chunk_table[i - 1], afhi->chunk_table[i],
                        afhi->chunk_table[i] - afhi->chunk_table[i - 1]);
@@ -192,15 +192,15 @@ int main(int argc, char **argv)
                        print_info(audio_format_num, &afhi);
                        if (conf.chunk_table_given)
                                print_chunk_table(&afhi);
-                       free(afhi.techinfo);
-                       free(afhi.tags.artist);
-                       free(afhi.tags.title);
-                       free(afhi.tags.year);
-                       free(afhi.tags.album);
-                       free(afhi.tags.comment);
-                       free(afhi.chunk_table);
                        printf("\n");
                }
+               free(afhi.techinfo);
+               free(afhi.tags.artist);
+               free(afhi.tags.title);
+               free(afhi.tags.year);
+               free(afhi.tags.album);
+               free(afhi.tags.comment);
+               free(afhi.chunk_table);
                ret2 = para_munmap(audio_file_data, audio_file_size);
                if (ret2 < 0 && ret >= 0)
                        ret = ret2;