Update PCM playback logic of ZSM player

This commit is contained in:
Zachary Hall 2024-10-15 15:00:28 -07:00
parent 7b2b050b34
commit acf868d412
2 changed files with 4 additions and 4 deletions

View file

@ -40,7 +40,7 @@
</TabInfo> </TabInfo>
<TabInfo> <TabInfo>
<wxString Value="/home/catmeow/neko-player/backends/playback/zsm/zsm_backend.cpp" Name="FileName"/> <wxString Value="/home/catmeow/neko-player/backends/playback/zsm/zsm_backend.cpp" Name="FileName"/>
<int Value="228" Name="FirstVisibleLine"/> <int Value="0" Name="FirstVisibleLine"/>
<int Value="0" Name="CurrentLine"/> <int Value="0" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/> <wxArrayString Name="Bookmarks"/>
<IntVector Name="CollapsedFolds"/> <IntVector Name="CollapsedFolds"/>
@ -131,8 +131,8 @@
</TabInfo> </TabInfo>
<TabInfo> <TabInfo>
<wxString Value="/home/catmeow/neko-player/backends/playback/zsm/zsm_backend.hpp" Name="FileName"/> <wxString Value="/home/catmeow/neko-player/backends/playback/zsm/zsm_backend.hpp" Name="FileName"/>
<int Value="60" Name="FirstVisibleLine"/> <int Value="0" Name="FirstVisibleLine"/>
<int Value="77" Name="CurrentLine"/> <int Value="0" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/> <wxArrayString Name="Bookmarks"/>
<IntVector Name="CollapsedFolds"/> <IntVector Name="CollapsedFolds"/>
</TabInfo> </TabInfo>

View file

@ -84,7 +84,7 @@ class ZsmBackend : public PlaybackBackend {
return (int16_t)((((int32_t)a) + ((int32_t)b)) >> 1); return (int16_t)((((int32_t)a) + ((int32_t)b)) >> 1);
} }
void audio_step(size_t samples) { void audio_step(size_t samples) {
while (((pcm_read_ctrl() & 0x80) == 0 || pcm_fifo_avail() < samples) && remain > 0) { while (pcm_fifo_avail() < samples && remain > 0) {
remain--; remain--;
size_t oldpos = file->get_pos(); size_t oldpos = file->get_pos();
file->seek((cur++), SeekType::SET); file->seek((cur++), SeekType::SET);