Add a new thread ("bufopen") that just adds files. Rename the playback thread codec... working_rb_in_rb
commit1bb751245fd364a72f2004dec0d388dcd1ba693c
authornico <nico@9862a28c-4e93-4879-ac26-10afcf840a8f>
Wed, 18 Jul 2007 18:35:16 +0000 (18 18:35 +0000)
committernico <nico@9862a28c-4e93-4879-ac26-10afcf840a8f>
Wed, 18 Jul 2007 18:35:16 +0000 (18 18:35 +0000)
tree5735dd688e28c872d644d01ea5610540037dd6e6
parentb19adf3dbd2b18c14ff02f93d013c8e6977b818d
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
testplugin.c