mirror of
https://github.com/pikvm/ustreamer.git
synced 2025-12-23 18:50:00 +00:00
Issue #253: Added m2m encoder timeout
This commit is contained in:
parent
f48695a04e
commit
1d8c93d3ad
@ -487,9 +487,17 @@ static int _m2m_encoder_compress_raw(us_m2m_encoder_s *enc, const us_frame_s *sr
|
||||
// Для не-DMA отправка буфера по факту являтся освобождением этого буфера
|
||||
bool input_released = !run->p_dma;
|
||||
|
||||
while (true) {
|
||||
struct pollfd enc_poll = {run->fd, POLLIN, 0};
|
||||
// https://github.com/pikvm/ustreamer/issues/253
|
||||
// За секунду точно должно закодироваться.
|
||||
const ldf deadline_ts = us_get_now_monotonic() + 1;
|
||||
|
||||
while (true) {
|
||||
if (us_get_now_monotonic() > deadline_ts) {
|
||||
_E_LOG_ERROR("Waiting for the encoder is too long");
|
||||
goto error;
|
||||
}
|
||||
|
||||
struct pollfd enc_poll = {run->fd, POLLIN, 0};
|
||||
_E_LOG_DEBUG("Polling encoder ...");
|
||||
if (poll(&enc_poll, 1, 1000) < 0 && errno != EINTR) {
|
||||
_E_LOG_PERROR("Can't poll encoder");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user