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
No related branches found
No related tags found
No related merge requests found
......@@ -27,10 +27,12 @@
#include <samplerate.h>
AudioFile::AudioFile()
: AudioLoop()
: AudioLoop(),
_filename(),
_codec(NULL),
_start(false)
{
// could vary later ...
_start = false;
}
AudioFile::~AudioFile()
......@@ -45,7 +47,7 @@ AudioFile::loadFile(const std::string& filename, AudioCodec* codec , unsigned in
// if the filename was already load, with the same samplerate
// we do nothing
if (_filename == filename && _sampleRate == sampleRate) {
if ( strcmp(_filename.c_str(), filename.c_str()) == 0 && _sampleRate == (int)sampleRate) {
return true;
} else {
// reset to 0
......@@ -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 should be exactly two time more, else failed
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) {
_debug("Audio file error on loading audio file!");
return false;
......
......@@ -33,6 +33,12 @@ public:
_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() {
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment