Send "last-chance retry" only once
The last-chance resend was sometimes fired up to 6 times (probably while
receiving multiple new packets while playing the same buffer-data).
The following patch corrects this: only one retry is sent out.
For this to happen, I change abuf->ready to -1 ("1 retry sent out") and
by changing the other comparisons of abuf->ready to != 1.
Probably, this could be improved, by implementing a first check at t-30,
t-20, t-10, ...
This commit is contained in:
+4
-2
@@ -393,8 +393,10 @@ void buffer_put_packet(seq_t seqno, char *data, int len) {
|
||||
// check if the t+10th packet has arrived... last-chance resend
|
||||
read = ab_read + 10;
|
||||
abuf = audio_buffer + BUFIDX(read);
|
||||
if (!abuf->ready)
|
||||
if (abuf->ready != 1) {
|
||||
rtp_request_resend(read, read);
|
||||
abuf->ready = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -671,7 +673,7 @@ short *buffer_get_frame(void) {
|
||||
bf_est_update(buf_fill);
|
||||
|
||||
volatile abuf_t *curframe = audio_buffer + BUFIDX(read);
|
||||
if (!curframe->ready) {
|
||||
if (curframe->ready != 1) {
|
||||
fprintf(stderr, "\nmissing frame.\n");
|
||||
memset(curframe->data, 0, FRAME_BYTES);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user