+static int loglevel;
+INIT_STDERR_LOGGING(loglevel)
+
+static void print_info(int audio_format_num, struct afh_info *afhi)
+{
+ char *msg;
+
+ afh_get_afhi_txt(audio_format_num, afhi, &msg);
+ printf("%s", msg);
+ free(msg);
+}
+
+static void print_chunk_table(struct afh_info *afhi)
+{
+ int i;
+
+ if (conf.parser_friendly_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 - 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]);
+ }
+}
+
+__noreturn static void print_help_and_die(void)
+{
+ struct ggo_help h = DEFINE_GGO_HELP(afh);
+ int d = conf.detailed_help_given;
+ unsigned flags = d? GPH_STANDARD_FLAGS_DETAILED : GPH_STANDARD_FLAGS;
+
+ ggo_print_help(&h, flags);
+ printf("supported audio formats: %s\n", AUDIO_FORMAT_HANDLERS);
+ exit(EXIT_SUCCESS);
+}
+
+/**
+ * The main function of para_afh.
+ *
+ * \param argc Usual argument count.
+ * \param argv Usual argument vector.
+ *
+ * \return \p EXIT_FAILURE or \p EXIT_SUCCESS.
+ */