If the stream start time announced by para_server is newer than the
time para_audiod started the receiver, we assume that para_audiod
was started in the middle of an audio stream and adjust the play
time accordingly.
However, the server stream time can also be newer due to clock
differences or network hiccups. This patch changes audiod to apply
the adjustment only if the time difference is large.
if (s->receiver_node->btrn) {
btr_get_node_start(s->receiver_node->btrn, &rstime);
ret = tv_diff(&rstime, &sss, &rskip);
- if (ret > 0) { /* audiod was started in the middle of the stream */
+ if (ret > 0 && rskip.tv_sec > 2) {
+ /* audiod was started in the middle of the stream */
tv_add(&wtime, &rskip, &sum);
seconds += sum.tv_sec;
} else