mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
Revert "libspark/record: always fill read buffer"
This reverts commit f77184cb68
.
This commit is contained in:
@@ -244,37 +244,29 @@ void cRecord::RecordThread()
|
|||||||
|
|
||||||
while (exit_flag == RECORD_RUNNING)
|
while (exit_flag == RECORD_RUNNING)
|
||||||
{
|
{
|
||||||
uint8_t *bufstart = io_buf[chunk];
|
ssize_t s = dmx->Read(io_buf[chunk], readsize, 50);
|
||||||
int left = readsize;
|
lt_debug("%s: Read chunk=%d size=%d\n", __func__, chunk, s);
|
||||||
ssize_t len = 0;
|
if (s < 0)
|
||||||
while ((exit_flag == RECORD_RUNNING) && (left > 0)) {
|
{
|
||||||
int s = dmx->Read(bufstart, left, 50);
|
if (errno != EAGAIN && (errno != EOVERFLOW || overflow_count > 63 /* arbitrary */))
|
||||||
lt_debug("%s: Read chunk=%d size=%d\n", __func__, chunk, s);
|
|
||||||
if (s < 0)
|
|
||||||
{
|
{
|
||||||
if (errno != EAGAIN && (errno != EOVERFLOW || overflow_count > 63 /* arbitrary */))
|
lt_info("%s: read failed: %m\n", __func__);
|
||||||
{
|
exit_flag = RECORD_FAILED_READ;
|
||||||
lt_info("%s: read failed: %m\n", __func__);
|
break;
|
||||||
exit_flag = RECORD_FAILED_READ;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (!overflow_count)
|
|
||||||
lt_info("%s: dmx->Read(): %m\n", __func__);
|
|
||||||
overflow_count++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
len += s;
|
|
||||||
left -= s;
|
|
||||||
bufstart += s;
|
|
||||||
if (overflow_count) {
|
|
||||||
lt_info("%s: Overflow cleared after %d iterations\n", __func__, overflow_count);
|
|
||||||
overflow_count = 0;
|
|
||||||
}
|
}
|
||||||
|
if (!overflow_count)
|
||||||
|
lt_info("%s: dmx->Read(): %m\n", __func__);
|
||||||
|
overflow_count++;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if (!len)
|
if (overflow_count) {
|
||||||
|
lt_info("%s: Overflow cleared after %d iterations\n", __func__, overflow_count);
|
||||||
|
overflow_count = 0;
|
||||||
|
}
|
||||||
|
if (!s)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
io_len[chunk] = len;
|
io_len[chunk] = s;
|
||||||
sem_post(&sem);
|
sem_post(&sem);
|
||||||
chunk++;
|
chunk++;
|
||||||
chunk %= RECORD_WRITER_CHUNKS;
|
chunk %= RECORD_WRITER_CHUNKS;
|
||||||
|
Reference in New Issue
Block a user