diff --git a/codecs.cpp b/codecs.cpp index 1782ccf..2a51648 100644 --- a/codecs.cpp +++ b/codecs.cpp @@ -173,7 +173,7 @@ bool AudioCodec::pause(const bool paused) /** from Fat16util.h 2008 by William Greiman**/ int AudioCodec::freeRam(void) { extern int __bss_end; - extern int* __brkval; + extern char* __brkval; int free_memory; if (reinterpret_cast(__brkval) == 0) { // if no heap use from end of bss section diff --git a/codecs.h b/codecs.h index be2a62b..172eb9e 100644 --- a/codecs.h +++ b/codecs.h @@ -136,7 +136,7 @@ class AudioCodec : public AudioStream, protected CodecFile AudioCodec(void) : AudioStream(0, NULL) {initVars();} bool pause(const bool paused); bool isPlaying(void) {return playing > 0;} - unsigned positionMillis(void) { return (AUDIO_SAMPLE_RATE_EXACT / 1000) * samples_played;} + unsigned positionMillis(void) { return (samples_played / AUDIO_SAMPLE_RATE_EXACT) * 1000;} unsigned lengthMillis(void) {return max(fsize() / (bitrate / 8 ) * 1000, positionMillis());} //Ignores VBR int channels(void) {return _channels;} int bitRate(void) {return bitrate;}