map

minimalistic audio player
git clone https://porkepik.fr/map
Log | Files | Refs | README | LICENSE

commit 1f62165c9d44416ddb52eddfb7018106ba1d87d9
parent 8f77b11e6588f76a49f60dab925a45e34817930d
Author: Thomas Philippe <dev@porkepik.fr>
Date:   Thu, 22 Aug 2019 22:35:44 +0200

fix integer casts

Diffstat:
Mflac.c | 2+-
Mmap.c | 2+-
Mmp3.c | 2+-
Mwav.c | 2+-
4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/flac.c b/flac.c @@ -39,7 +39,7 @@ void flac_seek(int sec) { long frame_index = (flac->currentSample / flac->channels) + - (sec * flac->currentFrame.header.sampleRate); + (sec * (long)flac->currentFrame.header.sampleRate); if (frame_index < 0) frame_index = 0; drflac_seek_to_pcm_frame(flac, frame_index); diff --git a/map.c b/map.c @@ -416,7 +416,7 @@ playtrack(struct track curtrack, struct player player, int trackid) errx(1, "Error during decoding."); } - timer_sec = (int) difftime(time(NULL), start); + timer_sec = difftime(time(NULL), start); display_timer(timer_sec, curtrack.length); } while (done); diff --git a/mp3.c b/mp3.c @@ -38,7 +38,7 @@ mp3_decode(void *buf, int nbytes) void mp3_seek(int sec) { - long frame_index = mp3.currentPCMFrame + (sec * mp3.sampleRate); + long frame_index = mp3.currentPCMFrame + (sec * (long)mp3.sampleRate); if (frame_index < 0) frame_index = 0; drmp3_seek_to_pcm_frame(&mp3, frame_index); diff --git a/wav.c b/wav.c @@ -39,7 +39,7 @@ void wav_seek(int sec) { long frame_index = (wav.dataChunkDataSize - wav.bytesRemaining) + - (sec * wav.fmt.avgBytesPerSec); + (sec * (long)wav.fmt.avgBytesPerSec); if (frame_index < 0) frame_index = 0; drwav_seek_to_pcm_frame(&wav, frame_index / 4);