{ 0, 0, 0, 0 }
};
-/** @Brief Return a new packet */
+/** @brief Return a new packet */
static struct packet *new_packet(void) {
struct packet *p;
* Must be called with @ref lock held.
*/
static void fill_buffer(void) {
+ while(nsamples)
+ drop_first_packet();
info("Buffering...");
while(nsamples < readahead)
pthread_cond_wait(&cond, &lock);
len = sizeof rcvbuf;
if(getsockopt(rtpfd, SOL_SOCKET, SO_RCVBUF, &rcvbuf, &len) < 0)
fatal(errno, "error calling getsockopt SO_RCVBUF");
- if(target_rcvbuf) {
+ if(target_rcvbuf > rcvbuf) {
if(setsockopt(rtpfd, SOL_SOCKET, SO_RCVBUF,
&target_rcvbuf, sizeof target_rcvbuf) < 0)
error(errno, "error calling setsockopt SO_RCVBUF %d",