I know, I just was not sure about the best logic. I still don't have Cygwin to test myself, but attached patch would probably work. I don't like it much though because it leaves the cache checks a bit spread all over the place.
It's better than what we have now, so commit it.
Applied then. Maybe someone makes it a proper configure option or something, there may be a few people who might like to try it on Linux or some other OSes, it might work better with gmplayer (it might also crash more, depending whether GTK is thread-safe enough).
It'd be nice to have on Linux and Darwin. I had my own patch to do something similar... I was going develop it a bit further, clean it up then sumbit it but you beat me to the punch :) The only _major_ difference I had was I moved the main cache loop into a separate function instead of #ifdef'ing the closing brace of stream_enable_cache (looks kinda sloppy). I haven't tested this version yet, but I will get around to it today or tomorrow... There's one problem I can see, pthread_t may or may not be a "unsigned int" sized value (esp. 64 bit systems) so I propose the following patch to stream/cache2.h. -DrD-