On Wednesday, July 2, 2003, at 09:19 PM, Rob Leslie wrote:
I'm open to better buffering suggestions, but most of my ideas revolve around an auxiliary thread either to pre-fetch data or to more generally split up the decoding process between reading and writing data.
FYI, that's the way I've gone in mpg321. A circular buffer with only one reader and only one writer has the benefit of needing no locking, too (only a method of sleeping and waking up readers + writers). In this way you can decode as fast as you can feed data through the CPU, and output can be as leisurely as is required.