Skip to content
Snippets Groups Projects
Commit 771ad6fa authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

fix warnings in src/audio/audiofile

parent 4ddcf71e
Branches
Tags
No related merge requests found
...@@ -27,10 +27,12 @@ ...@@ -27,10 +27,12 @@
#include <samplerate.h> #include <samplerate.h>
AudioFile::AudioFile() AudioFile::AudioFile()
: AudioLoop() : AudioLoop(),
_filename(),
_codec(NULL),
_start(false)
{ {
// could vary later ...
_start = false;
} }
AudioFile::~AudioFile() AudioFile::~AudioFile()
...@@ -45,7 +47,7 @@ AudioFile::loadFile(const std::string& filename, AudioCodec* codec , unsigned in ...@@ -45,7 +47,7 @@ AudioFile::loadFile(const std::string& filename, AudioCodec* codec , unsigned in
// if the filename was already load, with the same samplerate // if the filename was already load, with the same samplerate
// we do nothing // we do nothing
if (_filename == filename && _sampleRate == sampleRate) { if ( strcmp(_filename.c_str(), filename.c_str()) == 0 && _sampleRate == (int)sampleRate) {
return true; return true;
} else { } else {
// reset to 0 // reset to 0
...@@ -87,7 +89,7 @@ AudioFile::loadFile(const std::string& filename, AudioCodec* codec , unsigned in ...@@ -87,7 +89,7 @@ AudioFile::loadFile(const std::string& filename, AudioCodec* codec , unsigned in
// expandedsize is the number of bytes, not the number of int // expandedsize is the number of bytes, not the number of int
// expandedsize should be exactly two time more, else failed // expandedsize should be exactly two time more, else failed
int16 monoBuffer[length]; int16 monoBuffer[length];
unsigned int expandedsize = _codec->codecDecode (monoBuffer, (unsigned char *) fileBuffer, length); int expandedsize = (int)_codec->codecDecode (monoBuffer, (unsigned char *) fileBuffer, length);
if (expandedsize != length*2) { if (expandedsize != length*2) {
_debug("Audio file error on loading audio file!"); _debug("Audio file error on loading audio file!");
return false; return false;
......
...@@ -33,6 +33,12 @@ public: ...@@ -33,6 +33,12 @@ public:
_hasDynamicPayload = (_payload >= 96 && _payload <= 127) ? true : false; _hasDynamicPayload = (_payload >= 96 && _payload <= 127) ? true : false;
} }
AudioCodec( const AudioCodec& codec )
: _codecName(codec._codecName), _clockRate(codec._clockRate), _channel(codec._channel), _bitrate(codec._bitrate),_bandwidth(codec._bandwidth),_payload(codec._payload), _hasDynamicPayload(false),_state(true) {
_hasDynamicPayload = (_payload >= 96 && _payload <= 127) ? true : false;
}
virtual ~AudioCodec() { virtual ~AudioCodec() {
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment