- ret = compute_afhi(conf.inputs[0], audio_file_data, audio_file_size, &afhi);
- if (ret < 0)
- goto out;
- audio_format_num = ret;
- if (conf.stream_given)
- ret = cat_file(audio_file_data, &afhi);
- else {
- print_info(audio_format_num, &afhi);
- if (conf.chunk_table_given)
- print_chunk_table(&afhi);
- ret = 1;
+ afh_init();
+ for (i = 0; i < conf.inputs_num; i++) {
+ int ret2;
+ ret = mmap_full_file(conf.inputs[i], O_RDONLY, &audio_file_data,
+ &audio_file_size, &fd);
+ if (ret < 0)
+ goto out;
+ ret = compute_afhi(conf.inputs[i], audio_file_data, audio_file_size,
+ fd, &afhi);
+ if (ret < 0)
+ goto out;
+ audio_format_num = ret;
+ if (conf.stream_given)
+ ret = cat_file(audio_file_data, &afhi);
+ else {
+ printf("File %d: %s\n", i + 1, conf.inputs[i]);
+ print_info(audio_format_num, &afhi);
+ if (conf.chunk_table_given)
+ print_chunk_table(&afhi);
+ 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;
+ if (ret < 0)
+ break;