Update zsm pcm
This commit is contained in:
parent
de0422de20
commit
7ee0551c05
1 changed files with 17 additions and 15 deletions
|
@ -88,17 +88,19 @@ class ZsmBackend : public PlaybackBackend {
|
||||||
while (pcm_fifo_avail() < samples && remain > 0) {
|
while (pcm_fifo_avail() < samples && remain > 0) {
|
||||||
if (pcm_read_rate() == 0) break;
|
if (pcm_read_rate() == 0) break;
|
||||||
remain--;
|
remain--;
|
||||||
|
if (remain == 0) {
|
||||||
|
if (islooped) {
|
||||||
|
cur = loop;
|
||||||
|
remain = loop_rem;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
size_t oldpos = file->get_pos();
|
size_t oldpos = file->get_pos();
|
||||||
file->seek((cur++), SeekType::SET);
|
file->seek((cur++), SeekType::SET);
|
||||||
uint8_t sample;
|
uint8_t sample;
|
||||||
file->read(&sample, 1, 1);
|
file->read(&sample, 1, 1);
|
||||||
pcm_write_fifo(sample);
|
pcm_write_fifo(sample);
|
||||||
if (remain == 0) {
|
|
||||||
if (islooped) {
|
|
||||||
cur = loop;
|
|
||||||
remain = loop_rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file->seek(oldpos, SeekType::SET);
|
file->seek(oldpos, SeekType::SET);
|
||||||
}
|
}
|
||||||
samples *= 2;
|
samples *= 2;
|
||||||
|
|
Loading…
Reference in a new issue