/** @brief Buffer high watermark
*
* We'll only start playing when this many samples are available. */
-static unsigned readahead = 2 * 2 * 44100;
+static unsigned readahead = 44100; /* 0.5 seconds */
/** @brief Maximum buffer size
*
info("Playing...");
next_timestamp = pheap_first(&packets)->timestamp;
active = 1;
+ pthread_mutex_unlock(&lock);
backend->activate();
+ pthread_mutex_lock(&lock);
/* Wait until the buffer empties out */
while(nsamples >= minbuffer
|| (nsamples > 0
pthread_cond_wait(&cond, &lock);
}
/* Stop playing for a bit until the buffer re-fills */
+ pthread_mutex_unlock(&lock);
backend->deactivate();
+ pthread_mutex_lock(&lock);
active = 0;
/* Go back round */
}