Add buffer lock deadline for no frame
This commit is contained in:
parent
7275b56e6d
commit
885ec79f5b
@ -105,6 +105,7 @@ int buffer_lock_write_loop(buffer_lock_t *buf_lock, int nframes, buffer_write_fn
|
|||||||
{
|
{
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
int frames = 0;
|
int frames = 0;
|
||||||
|
uint64_t deadline_ms = get_monotonic_time_us(NULL, NULL) + DEFAULT_BUFFER_LOCK_GET_TIMEOUT * 1000LL;
|
||||||
|
|
||||||
buffer_lock_use(buf_lock, 1);
|
buffer_lock_use(buf_lock, 1);
|
||||||
|
|
||||||
@ -121,6 +122,9 @@ int buffer_lock_write_loop(buffer_lock_t *buf_lock, int nframes, buffer_write_fn
|
|||||||
frames++;
|
frames++;
|
||||||
} else if (ret < 0) {
|
} else if (ret < 0) {
|
||||||
goto error;
|
goto error;
|
||||||
|
} else if(!frames && deadline_ms < get_monotonic_time_us(NULL, NULL)) {
|
||||||
|
E_LOG_DEBUG(buf_lock, "Deadline getting frame elapsed.");
|
||||||
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user