mirror of
https://github.com/clangen/musikcube.git
synced 2024-10-02 13:02:35 +00:00
Fixed OpenMtpDecoder::Exhausted() and cleaned up a couple compile
warnings.
This commit is contained in:
parent
08cc42a9d0
commit
4bde6a33ea
@ -127,8 +127,11 @@ bool OpenMptDecoder::GetBuffer(IBuffer *target) {
|
|||||||
target->SetSampleRate(kSampleRate);
|
target->SetSampleRate(kSampleRate);
|
||||||
target->SetSamples(kSamplesPerChannel * kChannels);
|
target->SetSamples(kSamplesPerChannel * kChannels);
|
||||||
|
|
||||||
int samplesWritten = openmpt_module_read_interleaved_float_stereo(
|
int samplesWritten = (int) openmpt_module_read_interleaved_float_stereo(
|
||||||
this->module, kSampleRate, kSamplesPerChannel, target->BufferPointer());
|
this->module,
|
||||||
|
(int32_t) kSampleRate,
|
||||||
|
(size_t) kSamplesPerChannel,
|
||||||
|
target->BufferPointer());
|
||||||
|
|
||||||
if (samplesWritten > 0) {
|
if (samplesWritten > 0) {
|
||||||
target->SetSamples(samplesWritten * kChannels);
|
target->SetSamples(samplesWritten * kChannels);
|
||||||
@ -140,5 +143,8 @@ bool OpenMptDecoder::GetBuffer(IBuffer *target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool OpenMptDecoder::Exhausted() {
|
bool OpenMptDecoder::Exhausted() {
|
||||||
return false;
|
if (this->module) {
|
||||||
|
return openmpt_module_get_position_seconds(this->module) >= this->GetDuration();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user