/*
- * Copyright (C) 2008-2011 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2008-2012 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
#include "version.h"
static struct afh_args_info conf;
-/** The list of all status items */
-const char *status_item_list[] = {STATUS_ITEM_ARRAY};
-
INIT_AFH_ERRLISTS;
static int loglevel;
&header, &size);
if (size > 0) {
PARA_INFO_LOG("writing header (%zu bytes)\n", size);
- ret = write(STDOUT_FILENO, header, size); /* FIXME */
+ ret = write_all(STDOUT_FILENO, header, size);
afh_free_header(header, audio_format_id);
if (ret < 0)
return ret;
if (!size)
continue;
PARA_INFO_LOG("writing chunk %lu\n", i);
- ret = write_all(STDOUT_FILENO, buf, &size);
+ ret = write_all(STDOUT_FILENO, buf, size);
if (ret < 0)
return ret;
}
int ret2;
ret = mmap_full_file(conf.inputs[i], O_RDONLY, &audio_file_data,
&audio_file_size, &fd);
- if (ret < 0)
+ if (ret < 0) {
+ PARA_ERROR_LOG("failed to mmap \"%s\"\n", conf.inputs[i]);
goto out;
+ }
ret = compute_afhi(conf.inputs[i], audio_file_data, audio_file_size,
fd, &afhi);
if (ret < 0)
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);
+ clear_afhi(&afhi);
ret2 = para_munmap(audio_file_data, audio_file_size);
if (ret2 < 0 && ret >= 0)
ret = ret2;