map

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

commit 8f77b11e6588f76a49f60dab925a45e34817930d
parent 3c173429db347f68f5a83aaf9c8ccd33dd096fd5
Author: Thomas Philippe <dev@porkepik.fr>
Date:   Thu, 22 Aug 2019 21:01:45 +0200

remove int cast in seeking functions

Diffstat:
Mflac.c | 2+-
Mmp3.c | 2+-
Mwav.c | 2+-
3 files changed, 3 insertions(+), 3 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 * (int)flac->currentFrame.header.sampleRate); + (sec * flac->currentFrame.header.sampleRate); if (frame_index < 0) frame_index = 0; drflac_seek_to_pcm_frame(flac, frame_index); 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 * (int)mp3.sampleRate); + long frame_index = mp3.currentPCMFrame + (sec * 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 * (int)wav.fmt.avgBytesPerSec); + (sec * wav.fmt.avgBytesPerSec); if (frame_index < 0) frame_index = 0; drwav_seek_to_pcm_frame(&wav, frame_index / 4);