I am playing a audio file that is being streamed over the internet using a custom file system plugin. The sound when created has the nonblocking flag enabled. So, when data is not yet available and the filesystem plugin’s read function blocks the nonblocking thread, but the streaming thread doesn’t pause and wait for the data instead it keeps playing the last couple of miliseconds that it has in its buffer, like a broken record. Is there some way for the playing thread to block until the filesystem plugin returns and the buffers are properly filled?
This other pertains to seeking within a file – when I seek from one position to another in a audio stream, it seems like the buffers do not get flushed before being filled with data from the new location. So, there is a small sound of whatever is left in the buffer is played before the sound from the new location begins to play.
- aaiyer asked 10 years ago
- You must login to post comments