Add a new thread ("bufopen") that just adds files. Rename the playback thread codec thread. Fix bugs.
The bufopen thread will try adding a new file to the buffer every 8 seconds. There can now be between 0 and all the files on the buffer at the same time, which is much more interesting than only one.
The playback thread is now actually much closer to the real-life codec thread than the playback thread (though it's a very simple codec), so now is a good time to rename it.
Bugfixes:
* The part in bufgetdata() to copy a whole piece to the guard buffer if needed was totally wrong. It should be fine now.
* When adding a handle fails, close the file descriptor that was opened to get the file's size.
* When moving a handle, the alignment should be done backwards, or else we risk losing some data, and free_buffer() needs to check whether the movng succeeded.
* Before aligning the buffer write position to add a new handle, it's better to check whether we have enough space to do that.
* When we see we can't allocate enough space for the whole file, we need to make sure we take enough off the asked size, or else there might be a confusion between the empty and full states of the main buffer.
git-svn-id: svn://jdgordon.mine.nu/mob@61 9862a28c-4e93-4879-ac26-10afcf840a8f