]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge commit 'meins/master'
authorAndre Noll <maan@systemlinux.org>
Mon, 7 Dec 2009 17:07:21 +0000 (18:07 +0100)
committerAndre Noll <maan@systemlinux.org>
Mon, 7 Dec 2009 17:07:21 +0000 (18:07 +0100)
NEWS
afh.c
ggo/afh.m4

diff --git a/NEWS b/NEWS
index 3f6ae4590bf5febd511f5b71cebd635b12512a5c..019f936ef448c242a3ea5798e4475e33e7d89e44 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,7 +5,11 @@ NEWS
 0.4.1 (to be announced) "concurrent eternalty"
 ----------------------------------------------
 
+Support for another audio format and bug fixes: All fixes that have
+been accumulated in the 0.3.6 release appear in this release as well.
+
        - wma support
+       - new afh option: --human to activate human-readable output
 
 -------------------------------------
 0.3.6 (2009-12-07) "cubic continuity"
diff --git a/afh.c b/afh.c
index c00644939d1bdd04f5010729715af874725f4a86..7fc32cd1c583a035475888cf7ed69473b3402d84 100644 (file)
--- a/afh.c
+++ b/afh.c
@@ -62,10 +62,25 @@ static void print_chunk_table(struct afh_info *afhi)
 {
        int i;
 
-       printf("chunk_table: ");
-       for (i = 0; i <= afhi->chunks_total; i++)
-               printf("%u ", afhi->chunk_table[i]);
-       printf("\n");
+       if (!conf.human_given) {
+               printf("chunk_table: ");
+               for (i = 0; i <= afhi->chunks_total; i++)
+                       printf("%u ", afhi->chunk_table[i]);
+               printf("\n");
+               return;
+       }
+       for (i = 1; i <= afhi->chunks_total; i++) {
+               struct timeval tv;
+               long unsigned from, to;
+               tv_scale(i - 1, &afhi->chunk_tv, &tv);
+               from = tv2ms(&tv);
+               tv_scale(i, &afhi->chunk_tv, &tv);
+               to = tv2ms(&tv);
+               printf("%d [%lu.%03lu - %lu.%03lu] %u - %u (%u)\n", i,
+                       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]);
+       }
 }
 
 static int cat_file(void *audio_file_data, struct afh_info *afhi)
index 97b8f2888fdb7f1bb88ec9906d2c5e1e551aa261..80df8948dd79962e149679d98444364ffdb75023 100644 (file)
@@ -62,6 +62,20 @@ option "chunk_table" c
 flag off
 dependon="info"
 
+option "human" u
+#~~~~~~~~~~~~~~~
+"use human-readable output format"
+flag off
+dependon = "info"
+details = "
+       Currently this option only affects the format of the chunk table,
+       so it has no effect if --chunk_table is not given.
+
+       The human-readable output consists of one output line per
+       chunk and the output contains also the chunk number, the
+       duration and the size of each chunk.
+"
+
 section "Options for stream mode"
 #================================