if (ret < 0)
return ret;
afhi->chunks_total = ret;
- PARA_DEBUG_LOG("sz table has %lu entries\n", afhi->chunks_total);
+ PARA_DEBUG_LOG("sz table has %" PRIu32 " entries\n", afhi->chunks_total);
afhi->chunk_table = para_malloc((afhi->chunks_total + 1) * sizeof(size_t));
for (i = 1; i <= afhi->chunks_total; i++) {
if (skip + 4 > numbytes)
}
static int aac_set_chunk_tv(struct afh_info *afhi,
- mp4AudioSpecificConfig *mp4ASC, long unsigned *seconds)
+ mp4AudioSpecificConfig *mp4ASC, uint32_t *seconds)
{
float tmp = mp4ASC->sbr_present_flag == 1? 2047 : 1023;
struct timeval total;
ms = 1000.0 * afhi->chunks_total * tmp / mp4ASC->samplingFrequency;
ms2tv(ms, &total);
tv_divide(afhi->chunks_total, &total, &afhi->chunk_tv);
- PARA_INFO_LOG("%luHz, %lus (%lu x %lums)\n",
+ PARA_INFO_LOG("%luHz, %lus (%" PRIu32 " x %lums)\n",
mp4ASC->samplingFrequency, ms / 1000,
afhi->chunks_total, tv2ms(&afhi->chunk_tv));
if (ms < 1000)
/** Audio format dependent information. */
struct afh_info {
/** The number of chunks this audio file contains. */
- long unsigned chunks_total;
+ uint32_t chunks_total;
/** The length of the audio file in seconds. */
- long unsigned seconds_total;
+ uint32_t seconds_total;
/** Audio handler specific info about the file. */
char *techinfo;
/** Id3 tags, vorbis comments, aac tags. */
"%s: %s\n" /* format */
"%s: %dHz\n" /* frequency */
"%s: %d\n" /* channels */
- "%s: %lu\n" /* seconds total */
+ "%s: %" PRIu32 "\n" /* seconds total */
"%s: %lu: %lu\n" /* chunk time */
- "%s: %lu\n" /* num chunks */
+ "%s: %" PRIu32 "\n" /* num chunks */
"%s: %s\n" /* techinfo */
"%s: %s\n" /* artist */
"%s: %s\n" /* title */
*result = NULL;
if (!strcmp(cmd, "seconds_total")) {
- *result = make_message("%lu", pard->afhi.seconds_total);
+ *result = make_message("%" PRIu32, pard->afhi.seconds_total);
return 1;
}
if (!strcmp(cmd, "chunks_total")) {
- *result = make_message("%lu", pard->afhi.chunks_total);
+ *result = make_message("%" PRIu32, pard->afhi.chunks_total);
return 1;
}
if (!strcmp(cmd, "afhi")) {
WRITE_STATUS_ITEM(b, SI_FREQUENCY, "%dHz\n", afhi->frequency);
WRITE_STATUS_ITEM(b, SI_CHANNELS, "%d\n", afhi->channels);
WRITE_STATUS_ITEM(b, SI_DURATION, "%s\n", duration_buf);
- WRITE_STATUS_ITEM(b, SI_SECONDS_TOTAL, "%lu\n", afhi->seconds_total);
+ WRITE_STATUS_ITEM(b, SI_SECONDS_TOTAL, "%" PRIu32 "\n",
+ afhi->seconds_total);
WRITE_STATUS_ITEM(b, SI_LAST_PLAYED, "%s\n", last_played_time);
WRITE_STATUS_ITEM(b, SI_NUM_PLAYED, "%d\n", afsi->num_played);
WRITE_STATUS_ITEM(b, SI_AMPLIFICATION, "%u\n", afsi->amp);
WRITE_STATUS_ITEM(b, SI_CHUNK_TIME, "%lu\n", tv2ms(&afhi->chunk_tv));
- WRITE_STATUS_ITEM(b, SI_NUM_CHUNKS, "%lu\n", afhi->chunks_total);
+ WRITE_STATUS_ITEM(b, SI_NUM_CHUNKS, "%" PRIu32 "\n",
+ afhi->chunks_total);
WRITE_STATUS_ITEM(b, SI_TECHINFO, "%s\n", afhi->techinfo);
WRITE_STATUS_ITEM(b, SI_ARTIST, "%s\n", afhi->tags.artist);
WRITE_STATUS_ITEM(b, SI_TITLE, "%s\n", afhi->tags.title);
afhi->channels = header_channels(&header);
afhi->seconds_total = (tv2ms(&total_time) + 500) / 1000;
tv_divide(afhi->chunks_total, &total_time, &afhi->chunk_tv);
- PARA_DEBUG_LOG("%lu chunks, each %lums\n", afhi->chunks_total,
+ PARA_DEBUG_LOG("%" PRIu32 "chunks, each %lums\n", afhi->chunks_total,
tv2ms(&afhi->chunk_tv));
ret = mp3_get_id3(map, numbytes, fd, &afhi->tags);
afhi->techinfo = make_message("%cbr, %s, %s tags", vbr? 'v' : 'c',
afhi->seconds_total = num_frames / afhi->frequency;
/* use roughly one page per chunk */
frames_per_chunk = num_frames / i;
- PARA_INFO_LOG("%lu seconds, %d frames/chunk\n",
+ PARA_INFO_LOG("%" PRIu32 "seconds, %d frames/chunk\n",
afhi->seconds_total, frames_per_chunk);
ct_size = 250;
afhi->chunk_table = para_malloc(ct_size * sizeof(uint32_t));