# HG changeset patch # User arpi # Date 1034546415 0 # Node ID 328bbac6224c2598907d839842399df588d20e18 # Parent 1f8961f2b34c7191437345cf44dd4f7491c4d363 Fixes: - missing check in init - missing brackets causing failure - nas_aformat_to_auformat not working properly - fix hang that was finally reproducible with high disk activity - don't cut of audio on uninit(), wait for buffer to empty It also simplifies the event_handler, making it more readable and implements Sidik Isani's suggestion to make the buffer size dependent on bytes per second. I've been using it for two days and found no further problems. patch by Tobias Diedrich diff -r 1f8961f2b34c -r 328bbac6224c libao2/ao_nas.c --- a/libao2/ao_nas.c Sun Oct 13 21:58:55 2002 +0000 +++ b/libao2/ao_nas.c Sun Oct 13 22:00:15 2002 +0000 @@ -13,8 +13,8 @@ * Theory of operation: * * The NAS consists of two parts, a server daemon and a client. - * We setup the server to use a buffer of size NAS_BUFFER_SIZE - * with a low watermark of NAS_BUFFER_SIZE - NAS_FRAG_SIZE. + * We setup the server to use a buffer of size bytes_per_second + * with a low watermark of buffer_size - NAS_FRAG_SIZE. * Upon starting the flow the server will generate a buffer underrun * event and the event handler will fill the buffer for the first time. * Now the server will generate a lowwater event when the server buffer @@ -26,8 +26,10 @@ * accounting of what we think how much of the server buffer is filled) */ +#include #include #include +#include #include #include