From: Barry S. <bar...@on...> - 2006-03-31 15:20:50
|
We are testing the attached patch to input_rtp.c that fixes a number of problems. 1) Don't hang on a recv is no packets arrive 2) Fix buffer ring to be thread safe. (1) seemed to be needed to always be able to xine_stop, but may have been caused by (2). The buffer ring code has been simplified to make it easier to maintain. The variables buffer_head and buffer_tail have been changed to buffer_put_ptr and buffer_get_ptr to make the use clear (head and tail confused me). The three mutexes have been replaced with one mutex and the mutex is held when manipulating the buffer ring variables. This fixes the obvious bug that this->buffer_length checks where not locked. Which we think is why input_rtp will hang if you run for long enough. There is a debug message to detect the reader blocking for 2 seconds that will mean that the socket will be throwing away data. Note: you have to use sysctl to set net.core.rmem_max big enough to allow the setsockopt SO_RCVBUF to raise the socket buffer size above the default 100k. Feedback welcomed on this patch and the analysis please. Barry |