Avoid loading OGG segments into memory
authorfundamental <mark.d.mccurry@gmail.com>
Tue, 4 Jun 2019 01:00:20 +0000 (21:00 -0400)
committerfundamental <mark.d.mccurry@gmail.com>
Tue, 4 Jun 2019 01:00:20 +0000 (21:00 -0400)
commit9c3df9cb1e00b9bbcca75de060972e0d419a7190
tree27794c259e2ca27145c21d52b14279a2d1b63ff7
parentaecf98f4ad6dc1e2f297787bcd2420b30a7ac5f5
Avoid loading OGG segments into memory

Uses the virtual IO interface for sndfile providing pread() as the
mechanism for loading data from the file handle. pread() makes it
possible to read bytes from the file without impacting the offset
which would be altered with normal fread()/fseek() or
dup()+fread()/fseek() calls.

By avoiding changing the shared offset values, pread() makes it
possible to avoid multi-threaded data races while avoiding the
modest memory usage of loading a single audio track to memory.
src/curses/ux_audio.c