X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=mp3.c;h=ab05d2e7d62989e61305700cbccf997d2b3641ff;hp=c2d0f63e7ccd0dbe9a4c6727d4979b1055acba85;hb=ff067f37f441537ffec6ef4ee86420ebae727f9a;hpb=2ed89c59f0efcd0a2763f47c7d3455663241e623 diff --git a/mp3.c b/mp3.c index c2d0f63e..ab05d2e7 100644 --- a/mp3.c +++ b/mp3.c @@ -31,7 +31,6 @@ #include "server.cmdline.h" #include "server.h" #include "afs.h" -#include "gcc-compat.h" #include "error.h" /** \cond some defines and structs which are only used in this file */ @@ -102,7 +101,7 @@ static int mp3info_bitrate[2][3][14] = { }; static int frame_size_index[] = {24000, 72000, 72000}; -static char *mode_text[] = {"stereo", "joint stereo", "dual channel", "mono", "invalid"}; +static const char *mode_text[] = {"stereo", "joint stereo", "dual channel", "mono", "invalid"}; static struct mp3info mp3; static char mp3buf[8192]; @@ -126,7 +125,7 @@ static int header_frequency(struct mp3header *h) return frequencies[h->version][h->freq]; } -static char *header_mode(struct mp3header *h) +static const char *header_mode(struct mp3header *h) { if (h->mode > 4) h->mode = 4; /* invalid */ @@ -160,11 +159,11 @@ static void write_info_str(char *info_str) int v = mp3.id3_isvalid; snprintf(info_str, MMD_INFO_SIZE, - "audio_file_info1:%d x %lu, %lu kbit/s (%cbr) %i KHz %s\n" + "audio_file_info1:%d x %lums, %lu kbit/s (%cbr) %i KHz %s\n" "audio_file_info2:%s, by %s\n" "audio_file_info3:A: %s, Y: %s, C: %s\n", mp3.frames, - af->chunk_tv.tv_usec, + tv2ms(&af->chunk_tv), mp3.br_average, mp3.vbr? 'v' : 'c', mp3.freq / 1000, @@ -411,8 +410,9 @@ static int mp3_read_info(void) mp3.seconds = (tv2ms(&total_time) + 500) / 1000; tv_divide(fcount, &total_time, &af->chunk_tv); rewind(mp3.file); - PARA_DEBUG_LOG("chunk_time: %lu\n", af->chunk_tv.tv_usec); - tv_scale(10, &af->chunk_tv, &af->eof_tv); + PARA_DEBUG_LOG("chunk_time: %lums\n", tv2ms(&af->chunk_tv)); + tv_scale(30, &af->chunk_tv, &af->eof_tv); + PARA_DEBUG_LOG("eof timeout: %lu\n", tv2ms(&af->eof_tv)); return 1; } @@ -474,7 +474,7 @@ static int mp3_read_next_chunk(void) return chunk_size; } -static char *mp3_read_chunk(__unused long unsigned chunk_num, ssize_t *len) +static char *mp3_read_chunk(__a_unused long unsigned chunk_num, ssize_t *len) { *len = mp3_read_next_chunk(); if (*len <= 0)