X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=afh.c;h=b38dfbba056a321493226663849beab0d50ce273;hp=894cd78284d36c9de7ef1aa565894e6dd6017384;hb=7cb8fa26cfdcb3d34f8be2b86c48ffc6d7b9d84a;hpb=343a65bc48b4e0cda4d9a14afcd7e96cca9c5de9 diff --git a/afh.c b/afh.c index 894cd782..b38dfbba 100644 --- a/afh.c +++ b/afh.c @@ -1,11 +1,12 @@ /* - * Copyright (C) 2008-2009 Andre Noll + * Copyright (C) 2008-2010 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ /** \file afh.c Paraslash's standalone audio format handler tool. */ +#include #include #include @@ -61,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)